Add new attributes and bump type definition version to 4.0

This commit is contained in:
Gaëtan Maisse
2018-12-04 15:15:09 +01:00
parent 24077f2cd0
commit eae28b274e
2 changed files with 26 additions and 19 deletions
+5 -2
View File
@@ -1,13 +1,14 @@
// Type definitions for @storybook/addon-options 3.2
// Type definitions for @storybook/addon-options 4.0
// Project: https://github.com/storybooks/storybook
// Definitions by: Joscha Feth <https://github.com/joscha>
// Simon Helle Nielsen <https://github.com/simonhn>
// A.MacLeay <https://github.com/amacleay>
// Gaetan Maisse <https://github.com/gaetanmaisse>
// Adam Misiorny <https://github.com/adam187>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.8
import { StoryDecorator } from "@storybook/react";
import { StoryDecorator } from '@storybook/react';
export interface Options {
name?: string;
@@ -23,7 +24,9 @@ export interface Options {
sortStoriesByKind?: boolean;
hierarchySeparator?: RegExp | string;
hierarchyRootSeparator?: RegExp | string;
sidebarAnimations?: boolean;
selectedAddonPanel?: string;
enableShortcuts?: boolean;
}
/**
@@ -1,5 +1,23 @@
import { setOptions, withOptions } from '@storybook/addon-options';
import { addDecorator } from '@storybook/react';
import { setOptions, withOptions } from '@storybook/addon-options';
addDecorator(
withOptions({
name: 'My Storybook',
url: 'https://example.com',
goFullScreen: false,
showStoriesPanel: false,
showAddonPanel: false,
showSearchBox: false,
addonPanelInRight: false,
sortStoriesByKind: false,
hierarchySeparator: /\//,
hierarchyRootSeparator: /\|/,
sidebarAnimations: false,
selectedAddonPanel: 'storybook/actions/action-panel',
enableShortcuts: false
})
);
setOptions({
name: 'My Storybook',
@@ -12,7 +30,9 @@ setOptions({
sortStoriesByKind: false,
hierarchySeparator: /\//,
hierarchyRootSeparator: /\|/,
sidebarAnimations: false,
selectedAddonPanel: 'storybook/actions/action-panel',
enableShortcuts: false
});
setOptions({
@@ -32,19 +52,3 @@ setOptions({
hierarchySeparator: '.',
hierarchyRootSeparator: '#',
});
addDecorator(
withOptions({
name: "My Storybook",
url: "https://example.com",
goFullScreen: false,
showStoriesPanel: false,
showAddonPanel: false,
showSearchBox: false,
addonPanelInRight: false,
sortStoriesByKind: false,
hierarchySeparator: /\//,
hierarchyRootSeparator: /\|/,
selectedAddonPanel: "storybook/actions/action-panel"
})
);