This repository has been archived by the owner on Sep 22, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
types.ts
71 lines (61 loc) · 1.47 KB
/
types.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
export interface ComponentInfo {
name: string;
description: string;
source: string;
methods: MethodDescription[];
props: PropDescription[];
examples: string[];
enums: EnumDescription[];
types: CustomTypesDescription[];
extends?: { name: string; source: string; };
}
export interface UnionTypeDescription {
typeName: 'union';
types: TypeDescription[];
}
export interface ArrayTypeDescription {
typeName: 'array';
innerType: TypeDescription;
}
export interface ShapeTypeDescription {
typeName: 'shape';
name: string;
}
export interface EnumTypeDescription {
typeName: 'enum';
name: string;
}
export type TypeDescription = string
| EnumTypeDescription
| ShapeTypeDescription
| ArrayTypeDescription
| UnionTypeDescription;
export interface PropDescription {
name: string;
type: TypeDescription;
default: string;
required: boolean;
description: string; // jsdoc property description
}
export interface EnumDescription {
name: string;
values: string[];
}
export interface CustomTypesDescription {
name: string;
props: PropDescription[];
}
export interface MethodParamDescription {
name: string;
description: string;
type: { name: string; type: string; };
}
export interface MethodDescription {
name: string;
description: string;
params: MethodParamDescription[];
returns: {
description: string;
type: { name: string; type: string; };
};
}