/
types.ts
56 lines (52 loc) · 1.29 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
export interface ComponentMeta {
props: PropertyMeta[];
events: EventMeta[];
slots: SlotMeta[];
exposed: ExposeMeta[];
}
export interface PropertyMeta {
name: string;
default?: string;
description: string;
global: boolean;
required: boolean;
type: string;
rawType?: ts.Type;
tags: { name: string, text?: string; }[];
schema?: PropertyMetaSchema;
};
export interface EventMeta {
name: string;
type: string;
rawType?: ts.Type;
signature: string;
schema?: PropertyMetaSchema[];
}
export interface SlotMeta {
name: string;
type: string;
rawType?: ts.Type;
description: string;
schema?: PropertyMetaSchema;
}
export interface ExposeMeta {
name: string;
description: string;
type: string;
rawType?: ts.Type;
schema?: PropertyMetaSchema;
}
export type PropertyMetaSchema = string
| { kind: 'enum', type: string, schema?: PropertyMetaSchema[]; }
| { kind: 'array', type: string, schema?: PropertyMetaSchema[]; }
| { kind: 'event', type: string, schema?: PropertyMetaSchema[]; }
| { kind: 'object', type: string, schema?: Record<string, PropertyMeta>; };
export type MetaCheckerSchemaOptions = boolean | {
ignore?: string[];
};
export interface MetaCheckerOptions {
schema?: MetaCheckerSchemaOptions;
forceUseTs?: boolean;
printer?: import('typescript').PrinterOptions;
rawType?: boolean;
}