forked from storybookjs/storybook
-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.d.ts
45 lines (38 loc) · 1.25 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import { NgModuleMetadata, ICollection } from './dist/client/preview/angular/types';
export { moduleMetadata } from './dist/client/preview/angular/decorators';
export interface IStorybookStory {
name: string;
render: () => any;
}
/** @todo typo in Storibook */
export interface IStoribookSection {
kind: string;
stories: IStorybookStory[];
}
export interface IStoryContext {
kind: string;
name: string;
parameters: any;
}
export interface IStory {
props?: ICollection;
moduleMetadata?: Partial<NgModuleMetadata>;
component?: any;
template?: string;
}
export type IGetStory = (context: IStoryContext) => IStory;
export interface IApi {
kind: string;
addDecorator: (decorator: any) => IApi;
addParameters: (parameters: any) => IApi;
add: (storyName: string, getStory: IGetStory, parameters?: any) => IApi;
}
declare module '@storybook/angular' {
export function storiesOf(kind: string, module: NodeModule): IApi;
export function setAddon(addon: any): void;
export function addDecorator(decorator: any): IApi;
export function addParameters(parameters: any): IApi;
export function configure(loaders: () => void, module: NodeModule): void;
export function getStorybook(): IStoribookSection[];
export function forceReRender(): void;
}