-
Notifications
You must be signed in to change notification settings - Fork 1
/
types.d.ts
47 lines (37 loc) · 911 Bytes
/
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
export type Init = {
type: string,
parent: string,
class?: string,
id?: string
}
export type Css = Partial<CSSStyleDeclaration>
export type Prop = {
html?: string,
text?: string,
value?: string,
css?: Css
} | undefined
export type Events = {
[index in keyOf<HTMLElementEventMap>]?: EventListenerOrEventListenerObject
} | undefined
export type Attributes = {
[index:string]: string
} | undefined
export type States = {
[index:string]: any
}
export type ASubscriber<T> = {
subscriber: T,
states: string[]
}
export type Subscribers<T> = ASubscriber<T>[]
export type AnEffect = {
func: CallableFunction,
deps: string[],
ranOnce: boolean,
onFirst: boolean,
currentStates: any[];
}
export type Effects = AnEffect[]
export type Func<T, K> = (value:T) => K;
export type keyOf<T> = keyof T;