1 |
|
2 |
|
3 |
|
4 |
|
5 | export declare type callback = (mutations: MutationRecord[], observer: Mutation) => void;
|
6 |
|
7 |
|
8 |
|
9 | export default class Mutation {
|
10 | |
11 |
|
12 |
|
13 | protected observer: MutationObserver;
|
14 | |
15 |
|
16 |
|
17 | protected node?: Node;
|
18 | |
19 |
|
20 |
|
21 | protected options: MutationObserverInit;
|
22 | |
23 |
|
24 |
|
25 | protected callback: (mutations: MutationRecord[]) => void;
|
26 | |
27 |
|
28 |
|
29 |
|
30 |
|
31 | constructor(fn: callback, options?: MutationObserverInit);
|
32 | get target(): Node | undefined;
|
33 | /**
|
34 | * 绑定监听节点(初次绑定有效)
|
35 | * @param node 需要被监听的节点
|
36 | */
|
37 | observe(node: Node): void;
|
38 | /**
|
39 | * 连接监听器(开始观察)
|
40 | */
|
41 | connect(): this;
|
42 | /**
|
43 | * 断开监听器(停止观察)
|
44 | */
|
45 | disconnect(): void;
|
46 | }
|