@storybook/client-api

  • Version 6.5.12
  • Published
  • 109 kB
  • 20 dependencies
  • MIT license

Install

npm i @storybook/client-api
yarn add @storybook/client-api
pnpm add @storybook/client-api

Overview

Storybook Client API

Index

Functions

function addArgs

addArgs: (args: Args) => void;

    function addArgsEnhancer

    addArgsEnhancer: (enhancer: ArgsEnhancer<AnyFramework>) => void;

      function addArgTypes

      addArgTypes: (argTypes: ArgTypes) => void;

        function addArgTypesEnhancer

        addArgTypesEnhancer: (enhancer: ArgTypesEnhancer<AnyFramework>) => void;

          function addDecorator

          addDecorator: (
          decorator: DecoratorFunction<AnyFramework>,
          deprecationWarning?: boolean
          ) => void;

            function addLoader

            addLoader: (
            loader: LoaderFunction<AnyFramework>,
            deprecationWarning?: boolean
            ) => void;

              function addParameters

              addParameters: (parameters: Parameters, deprecationWarning?: boolean) => void;

                function getQueryParam

                getQueryParam: (
                key: string
                ) => string | string[] | import('qs').ParsedQs | import('qs').ParsedQs[];

                  function getQueryParams

                  getQueryParams: () => any;

                    function setGlobalRender

                    setGlobalRender: (render: StoryFn<AnyFramework>) => void;

                      Classes

                      class ClientApi

                      class ClientApi<TFramework extends AnyFramework> {}

                        constructor

                        constructor({ storyStore }?: { storyStore?: StoryStore<TFramework> });

                          property addArgs

                          addArgs: (args: Args) => void;

                            property addArgsEnhancer

                            addArgsEnhancer: (enhancer: ArgsEnhancer<TFramework>) => void;

                              property addArgTypes

                              addArgTypes: (argTypes: ArgTypes) => void;

                                property addArgTypesEnhancer

                                addArgTypesEnhancer: (enhancer: ArgTypesEnhancer<TFramework>) => void;

                                  property addDecorator

                                  addDecorator: (decorator: DecoratorFunction<TFramework>) => void;

                                    property addLoader

                                    addLoader: (loader: LoaderFunction<TFramework>) => void;

                                      property addParameters

                                      addParameters: ({ globals, globalTypes, ...parameters }: any) => void;

                                        property clearDecorators

                                        clearDecorators: () => void;

                                          property facade

                                          facade: StoryStoreFacade<TFramework>;

                                            property getStorybook

                                            getStorybook: () => GetStorybookKind<TFramework>[];

                                              property onImportFnChanged

                                              onImportFnChanged?: ({ importFn }: { importFn: ModuleImportFn }) => void;

                                                property raw

                                                raw: () => import('@storybook/store').BoundStory<TFramework>[];

                                                  property setAddon

                                                  setAddon: (addon: any) => void;

                                                    property storiesOf

                                                    storiesOf: (kind: string, m?: NodeModule) => StoryApi<TFramework['storyResult']>;

                                                      property storyStore

                                                      storyStore?: StoryStore<TFramework>;

                                                        method getStoryIndex

                                                        getStoryIndex: () => {
                                                        v: number;
                                                        stories: Record<string, import('@storybook/store').StoryIndexEntry>;
                                                        };

                                                          method importFn

                                                          importFn: (path: Path) => Promise<Record<string, any>>;

                                                            Interfaces

                                                            interface ClientApiAddon

                                                            interface ClientApiAddon<StoryFnReturnType = unknown> extends Addon {}

                                                              property apply

                                                              apply: (a: StoryApi<StoryFnReturnType>, b: any[]) => any;

                                                                interface ClientApiAddons

                                                                interface ClientApiAddons<StoryFnReturnType> {}

                                                                  index signature

                                                                  [key: string]: ClientApiAddon<StoryFnReturnType>;

                                                                    interface ClientApiParams

                                                                    interface ClientApiParams {}

                                                                      property decorateStory

                                                                      decorateStory?: ProjectAnnotations<AnyFramework>['applyDecorators'];

                                                                        property noStoryModuleAddMethodHotDispose

                                                                        noStoryModuleAddMethodHotDispose?: boolean;

                                                                          property storyStore

                                                                          storyStore: StoryStore<AnyFramework>;

                                                                            interface ErrorLike

                                                                            interface ErrorLike {}

                                                                              property message

                                                                              message: string;

                                                                                property stack

                                                                                stack: string;

                                                                                  interface GetStorybookKind

                                                                                  interface GetStorybookKind {}

                                                                                    property fileName

                                                                                    fileName: string;

                                                                                      property kind

                                                                                      kind: string;

                                                                                        property stories

                                                                                        stories: GetStorybookStory[];

                                                                                          interface GetStorybookStory

                                                                                          interface GetStorybookStory {}

                                                                                            property name

                                                                                            name: string;

                                                                                              property render

                                                                                              render: StoryFn;

                                                                                                interface StoreData

                                                                                                interface StoreData {}

                                                                                                  index signature

                                                                                                  [key: string]: StoreItem;

                                                                                                    interface StoreSelection

                                                                                                    interface StoreSelection {}

                                                                                                      property storyId

                                                                                                      storyId: StoryId;

                                                                                                        property viewMode

                                                                                                        viewMode: ViewMode;

                                                                                                          interface StoreSelectionSpecifier

                                                                                                          interface StoreSelectionSpecifier {}

                                                                                                            property args

                                                                                                            args?: Args;

                                                                                                              property globals

                                                                                                              globals?: Args;

                                                                                                                property singleStory

                                                                                                                singleStory?: boolean;

                                                                                                                  property storySpecifier

                                                                                                                  storySpecifier: StorySpecifier;

                                                                                                                    property viewMode

                                                                                                                    viewMode: ViewMode;

                                                                                                                      interface StoryMetadata

                                                                                                                      interface StoryMetadata {}

                                                                                                                        property decorators

                                                                                                                        decorators?: DecoratorFunction[];

                                                                                                                          property loaders

                                                                                                                          loaders?: LoaderFunction[];

                                                                                                                            property parameters

                                                                                                                            parameters?: Parameters;

                                                                                                                              Type Aliases

                                                                                                                              type AddStoryArgs

                                                                                                                              type AddStoryArgs = StoryIdentifier & {
                                                                                                                              storyFn: StoryFn<any>;
                                                                                                                              parameters?: Parameters;
                                                                                                                              decorators?: DecoratorFunction[];
                                                                                                                              loaders?: LoaderFunction[];
                                                                                                                              };

                                                                                                                                type ArgsEnhancer

                                                                                                                                type ArgsEnhancer = (context: StoryContext) => Args;

                                                                                                                                  type ArgTypesEnhancer

                                                                                                                                  type ArgTypesEnhancer = (context: StoryContext) => ArgTypes;

                                                                                                                                    type ClientApiReturnFn

                                                                                                                                    type ClientApiReturnFn<StoryFnReturnType> = (
                                                                                                                                    ...args: any[]
                                                                                                                                    ) => StoryApi<StoryFnReturnType>;

                                                                                                                                      type PublishedStoreItem

                                                                                                                                      type PublishedStoreItem = StoreItem & {
                                                                                                                                      globals: Args;
                                                                                                                                      };

                                                                                                                                        type RenderContextWithoutStoryContext

                                                                                                                                        type RenderContextWithoutStoryContext = Omit<RenderContext, 'storyContext'>;

                                                                                                                                          type StoreItem

                                                                                                                                          type StoreItem = StoryIdentifier & {
                                                                                                                                          parameters: Parameters;
                                                                                                                                          getDecorated: () => StoryFn<any>;
                                                                                                                                          getOriginal: () => StoryFn<any>;
                                                                                                                                          applyLoaders: () => Promise<StoryContext>;
                                                                                                                                          playFunction: (context: StoryContext) => Promise<void> | void;
                                                                                                                                          storyFn: StoryFn<any>;
                                                                                                                                          unboundStoryFn: StoryFn<any>;
                                                                                                                                          hooks: HooksContext<AnyFramework>;
                                                                                                                                          args: Args;
                                                                                                                                          initialArgs: Args;
                                                                                                                                          argTypes: ArgTypes;
                                                                                                                                          };

                                                                                                                                            Namespaces

                                                                                                                                            namespace global

                                                                                                                                            module 'global' {}

                                                                                                                                              Package Files (5)

                                                                                                                                              Dependencies (20)

                                                                                                                                              Dev Dependencies (0)

                                                                                                                                              No dev dependencies.

                                                                                                                                              Peer Dependencies (2)

                                                                                                                                              Badge

                                                                                                                                              To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

                                                                                                                                              You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@storybook/client-api.

                                                                                                                                              • Markdown
                                                                                                                                                [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/@storybook/client-api)
                                                                                                                                              • HTML
                                                                                                                                                <a href="https://www.jsdocs.io/package/@storybook/client-api"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>