-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.d.ts
More file actions
46 lines (36 loc) · 1.11 KB
/
index.d.ts
File metadata and controls
46 lines (36 loc) · 1.11 KB
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
/*
* define all types
*/
interface InsertionElement {
tagName: string;
attrs: object | any;
children: Array<InsertionElement> | string | InsertionElement;
}
// * dom elements functions
declare function Fragment (): string;
declare function insertionJsx(tagName: Function, attrs: object | any): string;
declare function createElement(node: string, target?: string | boolean): InsertionElement;
declare function render(vNode: InsertionElement): HTMLElement;
declare function mount(node: HTMLElement, target?: string | boolean): HTMLElement;
declare function diff(oldNode: InsertionElement, newNode: InsertionElement): Function;
declare function DidMount(callback: Function): void | any;
declare class Store {
public get state(): any;
public setState(state: any): void;
public addListener(Callback: Function): void;
private notify(): void;
public initState(state): void;
private exec(callbacks): void;
public BeforeUpdate(callback: Function): void;
public removeListener(listener: Function): void;
}
export {
insertionJsx,
createElement,
render,
mount,
diff,
DidMount,
Fragment,
Store,
};