1 |
|
2 |
|
3 |
|
4 | interface Window {
|
5 | |
6 |
|
7 |
|
8 | readonly browser: Browser;
|
9 | |
10 |
|
11 |
|
12 | readonly clipboardData: ClipboardData;
|
13 | |
14 |
|
15 |
|
16 |
|
17 |
|
18 | copy(str: string): void;
|
19 | }
|
20 | interface Browser {
|
21 | |
22 |
|
23 |
|
24 | readonly userAgent: string;
|
25 | |
26 |
|
27 |
|
28 | readonly name: string;
|
29 | |
30 |
|
31 |
|
32 | readonly version: string;
|
33 | |
34 |
|
35 |
|
36 | readonly isMobile: boolean;
|
37 | }
|
38 | interface Location {
|
39 | |
40 |
|
41 |
|
42 |
|
43 |
|
44 | getParameters(): Record<string, any>;
|
45 | |
46 |
|
47 |
|
48 |
|
49 |
|
50 |
|
51 | getParameter(name: string): any;
|
52 | }
|
53 | declare type ClipboardDataFormat = "text" | "url" | "file" | "html" | "image";
|
54 | declare var Window: {
|
55 | prototype: Window;
|
56 | new (): Window;
|
57 | };
|
58 | declare var Browser: {
|
59 | prototype: Browser;
|
60 | new (): Browser;
|
61 | };
|
62 | declare var Location: {
|
63 | prototype: Location;
|
64 | new (): Location;
|
65 | };
|
66 | interface ClipboardData {
|
67 | |
68 |
|
69 |
|
70 |
|
71 |
|
72 |
|
73 | setData(format: ClipboardDataFormat, content: string): void;
|
74 | }
|