From eae28b274e9bb589252eb928dd80b2992d01f09e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20Maisse?= Date: Sat, 17 Nov 2018 12:59:44 +0100 Subject: [PATCH] Add new attributes and bump type definition version to 4.0 --- types/storybook__addon-options/index.d.ts | 7 +++- .../storybook__addon-options-tests.ts | 38 ++++++++++--------- 2 files changed, 26 insertions(+), 19 deletions(-) diff --git a/types/storybook__addon-options/index.d.ts b/types/storybook__addon-options/index.d.ts index ec3ba1e252..968b003543 100644 --- a/types/storybook__addon-options/index.d.ts +++ b/types/storybook__addon-options/index.d.ts @@ -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 // Simon Helle Nielsen // A.MacLeay +// Gaetan Maisse // Adam Misiorny // 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; } /** diff --git a/types/storybook__addon-options/storybook__addon-options-tests.ts b/types/storybook__addon-options/storybook__addon-options-tests.ts index 1fc49d18e0..4321ecd72d 100644 --- a/types/storybook__addon-options/storybook__addon-options-tests.ts +++ b/types/storybook__addon-options/storybook__addon-options-tests.ts @@ -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" - }) -);