Repository navigation
Expand file tree
/
Copy pathdeclarations.d.ts
More file actions
122 lines (105 loc) · 3.05 KB
/
Copy pathdeclarations.d.ts
File metadata and controls
122 lines (105 loc) · 3.05 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
import "webextension-polyfill";
declare module "webextension-polyfill" {
namespace DeclarativeNetRequest {
interface Static {
MAX_NUMBER_OF_DYNAMIC_AND_SESSION_RULES: number;
}
}
namespace Storage {
interface Static {
session: StorageArea;
}
}
namespace Manifest {
interface WebExtensionManifestWebAccessibleResourcesC2ItemType {
use_dynamic_url?: boolean;
}
interface WebExtensionManifest {
optional_host_permissions?: MatchPattern[];
browser_url_overrides?: WebExtensionManifestChromeUrlOverridesType;
}
}
namespace Tabs {
interface Static {
group: (options: {
createProperties?: { windowId?: number };
groupId?: number;
tabIds?: number | number[];
}) => Promise<number>;
}
}
}
declare global {
type FileSystemDirectoryNamesIterator = AsyncIterable<string>;
type FileSystemDirectoryHandlesIterator = AsyncIterable<FileSystemDirectoryHandle | FileSystemFileHandle>;
type FileSystemDirectoryEntriesIterator = AsyncIterable<[string, FileSystemDirectoryHandle | FileSystemFileHandle]>;
interface FileSystemDirectoryHandle {
keys(): FileSystemDirectoryNamesIterator;
values(): FileSystemDirectoryHandlesIterator;
entries(): FileSystemDirectoryEntriesIterator;
}
interface FileSystemSyncAccessHandle {
write(buf: ArrayBuffer | ArrayBufferView, opt?: { at: number }): number; // MDN says it's actually Promise, but that seem to be typo
flush(): void;
close(): void;
}
interface FileSystemFileHandle {
createWritable(): Promise<FileSystemWritableFileStream>;
createSyncAccessHandle(): Promise<FileSystemSyncAccessHandle>;
}
type TabGroupColor = "grey" | "blue" | "red" | "yellow" | "green" | "pink" | "purple" | "cyan" | "orange";
interface TabGroup {
collapsed: boolean;
color: TabGroupColor;
id: number;
windowId: number;
title?: string;
}
interface ChromeTabGroupsStatic {
update: (
groupId: number,
updateProperties: { collapsed?: boolean; color?: TabGroupColor; title?: string },
) => Promise<TabGroup | undefined>;
}
interface ChromeTabsStatic {
group: (options: {
createProperties?: { windowId?: number };
groupId?: number;
tabIds?: number | number[];
}) => Promise<number>;
}
type CpuTime = {
idle: number;
kernel: number;
total: number;
user: number;
};
type ProcessorInfo = {
usage: CpuTime;
};
type CpuInfo = {
archName: string;
features: ("mmx" | "sse" | "sse2" | "sse3" | "ssse3" | "sse4_1" | "sse4_2" | "avx")[];
modelName: string;
numOfProcessors: number;
processors: ProcessorInfo[];
temperatures: number[];
};
interface MemoryInfo {
availableCapacity: number;
capacity: number;
}
interface ChromeSystemStatic {
cpu: {
getInfo: () => Promise<CpuInfo>;
};
memory: {
getInfo: () => Promise<MemoryInfo>;
};
}
type ChromeBrowserAdditions = {
tabGroups: ChromeTabGroupsStatic;
tabs: ChromeTabsStatic;
system: ChromeSystemStatic;
};
}