@storybook/addon-docs
Version:
Superior documentation for your components
27 lines (26 loc) • 974 B
TypeScript
import { FunctionComponent } from 'react';
import { SourceProps as PureSourceProps } from '@storybook/components';
import { DocsContextProps } from './DocsContext';
interface CommonProps {
language?: string;
dark?: boolean;
}
declare type SingleSourceProps = {
id: string;
} & CommonProps;
declare type MultiSourceProps = {
ids: string[];
} & CommonProps;
declare type CodeProps = {
code: string;
} & CommonProps;
declare type NoneProps = CommonProps;
declare type SourceProps = SingleSourceProps | MultiSourceProps | CodeProps | NoneProps;
export declare const getSourceProps: (props: SourceProps, { id: currentId, storyStore }: DocsContextProps) => PureSourceProps;
/**
* Story source doc block renders source code if provided,
* or the source for a story if `storyId` is provided, or
* the source for the current story if nothing is provided.
*/
declare const SourceContainer: FunctionComponent<SourceProps>;
export { SourceContainer as Source };