-
-
Notifications
You must be signed in to change notification settings - Fork 9.1k
/
types.d.ts
49 lines (41 loc) · 1.21 KB
/
types.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
46
47
48
49
import { ComponentProps, FunctionComponent } from 'react';
import { Icons } from '@storybook/components';
export { API as ManagerAPI } from '@storybook/api';
// helpers
export declare type AnyFunctionReturns<T> = (...arg: any[]) => T;
export declare type FCNoChildren<P> = FunctionComponent<{ children?: never } & P>;
export declare type GenericProp = null | {
readonly [key: string]: unknown;
};
// interfaces
export declare interface AddonOptions {
deep?: boolean;
disable?: boolean;
cancelable?: boolean;
}
export declare interface AddonSetting {
icon?: ComponentProps<typeof Icons>['icon'] | '';
title: string;
components?: unknown[];
params?: {
name: string;
props: GenericProp;
default?: boolean;
}[];
options?: AddonOptions;
}
export declare interface ContextNode extends Required<AddonSetting> {
nodeId: string;
options: Required<AddonOptions>;
}
export declare interface SelectionState {
readonly [key: string]: string | undefined;
}
export declare interface PropsMap {
readonly [key: string]: GenericProp;
}
export declare interface WrapperSettings {
options?: AddonSetting[];
// `parameters` can be set to `false` to disable the addon
parameters?: AddonSetting[] | false;
}