-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtypes.ts
72 lines (51 loc) · 1.45 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
72
import { Node as BabelNode, Comment, SourceLocation } from '@babel/types';
// export interface BaseNode {
// [key: string]: any;
// }
export interface BaseNode {
leadingComments: ReadonlyArray<Comment> | null;
innerComments: ReadonlyArray<Comment> | null;
trailingComments: ReadonlyArray<Comment> | null;
start: number | null;
end: number | null;
loc: SourceLocation | null;
type: BabelNode['type'];
}
export interface Options {
[key: string]: any;
}
export type BundleType = 0 | 1;
export type Type = string;
export type Prop = any;
export type ContextItem = any;
export type HydratableInstance = any;
export type PublicInstance = Instance | TextInstance;
export type HostContext = Context;
export type UpdatePayload = any;
export type ChildSet = any;
export type TimeoutHandle = any;
export type NoTimeout = any;
export interface Container extends Instance {}
export interface TextInstance extends Instance {}
export interface DeepArray<T> extends Array<T | DeepArray<T>> {}
export interface Props {
[key: string]: Prop;
}
export interface Instance {
appendChild(child: Instance | TextInstance): void;
children: Instance[];
commitMount(): void;
commitUpdate(newProps: Props): void;
node: Node;
props: Props;
removeChild(child: Instance | TextInstance): void;
}
export interface Pkg {
[key: string]: any;
}
export interface Context {
[key: string]: ContextItem;
}
export interface Node extends BaseNode {
body?: BaseNode[];
}