UNPKG

1.57 kBTypeScriptView Raw
1import { SFC, ComponentType } from 'react';
2export interface EnumValue {
3 value: string;
4 computed: boolean;
5}
6export interface FlowTypeElement {
7 name: string;
8 value: string;
9}
10export interface FlowTypeArgs {
11 name: string;
12 type: {
13 name: string;
14 };
15}
16export interface PropType {
17 name: string;
18 value?: any;
19 raw?: any;
20 computed?: boolean;
21}
22export interface FlowType extends PropType {
23 elements: FlowTypeElement[];
24 name: string;
25 raw: string;
26 type?: string;
27 computed?: boolean;
28 signature?: {
29 arguments: FlowTypeArgs[];
30 return: {
31 name: string;
32 };
33 };
34}
35export interface Prop {
36 required: boolean;
37 description?: string;
38 type: PropType;
39 defaultValue?: {
40 value: string;
41 computed: boolean;
42 };
43 flowType?: FlowType;
44}
45export declare type ComponentWithDocGenInfo = ComponentType & {
46 __docgenInfo: {
47 description?: string;
48 props?: Record<string, Prop>;
49 };
50};
51export interface PropsProps {
52 title?: Node;
53 isRaw?: boolean;
54 isToggle?: boolean;
55 of: ComponentWithDocGenInfo;
56 [key: string]: any;
57}
58export declare const getPropType: (prop: Prop) => any;
59export interface PropsComponentProps {
60 title?: Node;
61 isRaw?: boolean;
62 isToggle?: boolean;
63 props: Record<string, Prop>;
64 getPropType(prop: Prop): string;
65 of: ComponentWithDocGenInfo;
66 [key: string]: any;
67}
68export declare const Props: SFC<PropsProps>;