1 | interface Window {
|
2 | ResizeObserver: ResizeObserver
|
3 | }
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 | interface ResizeObserver {
|
12 | new (callback: ResizeObserverCallback)
|
13 |
|
14 | |
15 |
|
16 |
|
17 | observe: (target: Element) => void
|
18 |
|
19 | |
20 |
|
21 |
|
22 | unobserve: (target: Element) => void
|
23 |
|
24 | |
25 |
|
26 |
|
27 | disconnect: () => void
|
28 | }
|
29 |
|
30 |
|
31 |
|
32 |
|
33 |
|
34 | interface ResizeObserverCallback {
|
35 | (entries: ResizeObserverEntry[], observer: ResizeObserver): void
|
36 | }
|
37 |
|
38 | interface ResizeObserverEntry {
|
39 | |
40 |
|
41 |
|
42 | new (target: Element)
|
43 |
|
44 | |
45 |
|
46 |
|
47 | readonly target: Element
|
48 |
|
49 | |
50 |
|
51 |
|
52 | readonly contentRect: DOMRectReadOnly
|
53 | }
|
54 |
|
55 | interface DOMRectReadOnly {
|
56 | fromRect(other: DOMRectInit | undefined): DOMRectReadOnly
|
57 |
|
58 | readonly x: number
|
59 | readonly y: number
|
60 | readonly width: number
|
61 | readonly height: number
|
62 | readonly top: number
|
63 | readonly right: number
|
64 | readonly bottom: number
|
65 | readonly left: number
|
66 |
|
67 | toJSON: () => any
|
68 | }
|