1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 | export interface ElementConstructor {
|
18 | new (): Element;
|
19 | }
|
20 |
|
21 | export type AttrMutator = (a: Element, b: string, c: any) => void;
|
22 |
|
23 | export interface AttrMutatorConfig {
|
24 | [x: string]: AttrMutator;
|
25 | }
|
26 |
|
27 | export type NameOrCtorDef = string | ElementConstructor;
|
28 |
|
29 | export type Key = string | number | null | undefined;
|
30 |
|
31 | export type Statics = Array<{}> | null | undefined;
|
32 |
|
33 | export type PatchFunction<T, R> = (
|
34 | node: Element | DocumentFragment,
|
35 | template: (a: T | undefined) => void,
|
36 | data?: T | undefined
|
37 | ) => R;
|
38 |
|
39 | export type MatchFnDef = (
|
40 | matchNode: Node,
|
41 | nameOrCtor: NameOrCtorDef,
|
42 | expectedNameOrCtor: NameOrCtorDef,
|
43 | key: Key,
|
44 | expectedKey: Key
|
45 | ) => boolean;
|
46 |
|
47 | export interface PatchConfig {
|
48 | matches?: MatchFnDef;
|
49 | }
|