extension 4.1.40 → 4.1.41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.cjs +1 -1
- package/dist/extension/helpers/template-catalog.d.ts +1 -1
- package/dist/extension/helpers/template-corpus.generated.d.ts +1 -1
- package/package.json +4 -4
- package/types/callbacks.d.ts +594 -0
- package/types/chrome.d.ts +44 -0
- package/types/enums.d.ts +979 -0
- package/types/index.d.ts +3 -0
package/dist/cli.cjs
CHANGED
|
@@ -14224,7 +14224,7 @@ function describeButton(b) {
|
|
|
14224
14224
|
}
|
|
14225
14225
|
var messaging = __webpack_require__("./helpers/messaging.ts");
|
|
14226
14226
|
const TEMPLATE_CORPUS_REPO = 'extension-js/templates';
|
|
14227
|
-
const TEMPLATE_CORPUS_REF = '
|
|
14227
|
+
const TEMPLATE_CORPUS_REF = 'd3ea8e24e52bed294f89a93d76d9661c4dfba241';
|
|
14228
14228
|
const TEMPLATE_CORPUS_SLUGS = [
|
|
14229
14229
|
'action',
|
|
14230
14230
|
'action-locales',
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export declare const DEFAULT_TEMPLATE = "typescript";
|
|
2
2
|
export declare const BUNDLED_TEMPLATES: readonly string[];
|
|
3
|
-
export declare const TEMPLATE_CATALOG_URL = "https://github.com/extension-js/templates/tree/
|
|
3
|
+
export declare const TEMPLATE_CATALOG_URL = "https://github.com/extension-js/templates/tree/d3ea8e24e52bed294f89a93d76d9661c4dfba241/examples";
|
|
4
4
|
export interface TemplateGroup {
|
|
5
5
|
title: string;
|
|
6
6
|
summary: string;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export declare const TEMPLATE_CORPUS_REPO = "extension-js/templates";
|
|
2
|
-
export declare const TEMPLATE_CORPUS_REF = "
|
|
2
|
+
export declare const TEMPLATE_CORPUS_REF = "d3ea8e24e52bed294f89a93d76d9661c4dfba241";
|
|
3
3
|
export declare const TEMPLATE_CORPUS_SLUGS: readonly string[];
|
package/package.json
CHANGED
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"extension": "./bin/extension.cjs"
|
|
42
42
|
},
|
|
43
43
|
"name": "extension",
|
|
44
|
-
"version": "4.1.
|
|
44
|
+
"version": "4.1.41",
|
|
45
45
|
"description": "The cross-browser extension framework. Build Chrome, Edge, Firefox, and Safari extensions with no build configuration.",
|
|
46
46
|
"homepage": "https://extension.js.org/",
|
|
47
47
|
"funding": "https://github.com/sponsors/cezaraugusto",
|
|
@@ -107,9 +107,9 @@
|
|
|
107
107
|
"chromium-location": "2.1.2",
|
|
108
108
|
"commander": "^15.0.0",
|
|
109
109
|
"edge-location": "2.3.1",
|
|
110
|
-
"extension-create": "4.1.
|
|
111
|
-
"extension-develop": "4.1.
|
|
112
|
-
"extension-install": "4.1.
|
|
110
|
+
"extension-create": "4.1.41",
|
|
111
|
+
"extension-develop": "4.1.41",
|
|
112
|
+
"extension-install": "4.1.41",
|
|
113
113
|
"firefox-location2": "3.2.0",
|
|
114
114
|
"floorp-location": "1.0.0",
|
|
115
115
|
"librewolf-location": "1.2.1",
|
|
@@ -0,0 +1,594 @@
|
|
|
1
|
+
// Generated by scripts/generate-callback-types.mjs from the chrome-types
|
|
2
|
+
// declarations. Do not edit: run the script again when chrome-types moves.
|
|
3
|
+
// The browser accepts a callback right after the arguments that were given.
|
|
4
|
+
// chrome-types declares it only after every optional argument.
|
|
5
|
+
// biome-ignore-all lint/suspicious/noExplicitAny: the argument types are copied from chrome-types
|
|
6
|
+
/// <reference types="chrome-types" />
|
|
7
|
+
|
|
8
|
+
// An argument typed any is not taken for a callback, so a call that
|
|
9
|
+
// passes one keeps the promise form chrome-types declares.
|
|
10
|
+
type ExtensionCallback<F> = 0 extends 1 & F ? never : F
|
|
11
|
+
|
|
12
|
+
declare namespace browser.action {
|
|
13
|
+
export function enable<F extends () => void>(
|
|
14
|
+
callback: ExtensionCallback<F>
|
|
15
|
+
): void
|
|
16
|
+
export function disable<F extends () => void>(
|
|
17
|
+
callback: ExtensionCallback<F>
|
|
18
|
+
): void
|
|
19
|
+
export function isEnabled<F extends (isEnabled: boolean) => void>(
|
|
20
|
+
callback: ExtensionCallback<F>
|
|
21
|
+
): void
|
|
22
|
+
export function openPopup<F extends () => void>(
|
|
23
|
+
callback: ExtensionCallback<F>
|
|
24
|
+
): void
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
declare namespace browser.alarms {
|
|
28
|
+
export function get<F extends (alarm?: Alarm) => void>(
|
|
29
|
+
callback: ExtensionCallback<F>
|
|
30
|
+
): void
|
|
31
|
+
export function clear<F extends (wasCleared: boolean) => void>(
|
|
32
|
+
callback: ExtensionCallback<F>
|
|
33
|
+
): void
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
declare namespace browser.audio {
|
|
37
|
+
export function getDevices<F extends (devices: AudioDeviceInfo[]) => void>(
|
|
38
|
+
callback: ExtensionCallback<F>
|
|
39
|
+
): void
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
declare namespace browser._debugger {
|
|
43
|
+
export function sendCommand<
|
|
44
|
+
F extends (result?: {[name: string]: any}) => void
|
|
45
|
+
>(
|
|
46
|
+
target: DebuggerSession,
|
|
47
|
+
method: string,
|
|
48
|
+
callback: ExtensionCallback<F>
|
|
49
|
+
): void
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
declare namespace browser.declarativeNetRequest {
|
|
53
|
+
export function getDynamicRules<F extends (rules: Rule[]) => void>(
|
|
54
|
+
callback: ExtensionCallback<F>
|
|
55
|
+
): void
|
|
56
|
+
export function getSessionRules<F extends (rules: Rule[]) => void>(
|
|
57
|
+
callback: ExtensionCallback<F>
|
|
58
|
+
): void
|
|
59
|
+
export function getMatchedRules<
|
|
60
|
+
F extends (details: RulesMatchedDetails) => void
|
|
61
|
+
>(callback: ExtensionCallback<F>): void
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
declare namespace browser.devtools.inspectedWindow {
|
|
65
|
+
export function _eval<T = unknown>(
|
|
66
|
+
expression: string,
|
|
67
|
+
callback: (
|
|
68
|
+
result: T,
|
|
69
|
+
exceptionInfo: {
|
|
70
|
+
isError: boolean
|
|
71
|
+
code: string
|
|
72
|
+
description: string
|
|
73
|
+
details: any[]
|
|
74
|
+
isException: boolean
|
|
75
|
+
value: string
|
|
76
|
+
}
|
|
77
|
+
) => void
|
|
78
|
+
): void
|
|
79
|
+
export function _eval<T = unknown>(
|
|
80
|
+
expression: string,
|
|
81
|
+
options: {
|
|
82
|
+
frameURL?: string
|
|
83
|
+
useContentScriptContext?: boolean
|
|
84
|
+
scriptExecutionContext?: string
|
|
85
|
+
},
|
|
86
|
+
callback: (
|
|
87
|
+
result: T,
|
|
88
|
+
exceptionInfo: {
|
|
89
|
+
isError: boolean
|
|
90
|
+
code: string
|
|
91
|
+
description: string
|
|
92
|
+
details: any[]
|
|
93
|
+
isException: boolean
|
|
94
|
+
value: string
|
|
95
|
+
}
|
|
96
|
+
) => void
|
|
97
|
+
): void
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
declare namespace browser.devtools.panels {
|
|
101
|
+
export function openResource<F extends () => void>(
|
|
102
|
+
url: string,
|
|
103
|
+
lineNumber: number,
|
|
104
|
+
callback: ExtensionCallback<F>
|
|
105
|
+
): void
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
declare namespace browser.downloads {
|
|
109
|
+
export function getFileIcon<F extends (iconURL?: string) => void>(
|
|
110
|
+
downloadId: number,
|
|
111
|
+
callback: ExtensionCallback<F>
|
|
112
|
+
): void
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
declare namespace browser.enterprise.platformKeys {
|
|
116
|
+
export function challengeMachineKey<
|
|
117
|
+
F extends (response: ArrayBuffer) => void
|
|
118
|
+
>(challenge: ArrayBuffer, callback: ExtensionCallback<F>): void
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
declare namespace browser.fontSettings {
|
|
122
|
+
export function clearDefaultFontSize<F extends () => void>(
|
|
123
|
+
callback: ExtensionCallback<F>
|
|
124
|
+
): void
|
|
125
|
+
export function getDefaultFontSize<
|
|
126
|
+
F extends (details: {
|
|
127
|
+
pixelSize: number
|
|
128
|
+
levelOfControl: LevelOfControl
|
|
129
|
+
}) => void
|
|
130
|
+
>(callback: ExtensionCallback<F>): void
|
|
131
|
+
export function clearDefaultFixedFontSize<F extends () => void>(
|
|
132
|
+
callback: ExtensionCallback<F>
|
|
133
|
+
): void
|
|
134
|
+
export function getDefaultFixedFontSize<
|
|
135
|
+
F extends (details: {
|
|
136
|
+
pixelSize: number
|
|
137
|
+
levelOfControl: LevelOfControl
|
|
138
|
+
}) => void
|
|
139
|
+
>(callback: ExtensionCallback<F>): void
|
|
140
|
+
export function clearMinimumFontSize<F extends () => void>(
|
|
141
|
+
callback: ExtensionCallback<F>
|
|
142
|
+
): void
|
|
143
|
+
export function getMinimumFontSize<
|
|
144
|
+
F extends (details: {
|
|
145
|
+
pixelSize: number
|
|
146
|
+
levelOfControl: LevelOfControl
|
|
147
|
+
}) => void
|
|
148
|
+
>(callback: ExtensionCallback<F>): void
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
declare namespace browser.identity {
|
|
152
|
+
export function getAuthToken<F extends (result: GetAuthTokenResult) => void>(
|
|
153
|
+
callback: ExtensionCallback<F>
|
|
154
|
+
): void
|
|
155
|
+
export function getProfileUserInfo<
|
|
156
|
+
F extends (userInfo: ProfileUserInfo) => void
|
|
157
|
+
>(callback: ExtensionCallback<F>): void
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
declare namespace browser.management {
|
|
161
|
+
export function uninstall<F extends () => void>(
|
|
162
|
+
id: string,
|
|
163
|
+
callback: ExtensionCallback<F>
|
|
164
|
+
): void
|
|
165
|
+
export function uninstallSelf<F extends () => void>(
|
|
166
|
+
callback: ExtensionCallback<F>
|
|
167
|
+
): void
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
declare namespace browser.runtime {
|
|
171
|
+
export function sendMessage<F extends (response: any) => void>(
|
|
172
|
+
extensionId: string,
|
|
173
|
+
message: any,
|
|
174
|
+
callback: ExtensionCallback<F>
|
|
175
|
+
): void
|
|
176
|
+
export function sendMessage<F extends (response: any) => void>(
|
|
177
|
+
message: any,
|
|
178
|
+
callback: ExtensionCallback<F>
|
|
179
|
+
): void
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
declare namespace browser.scripting {
|
|
183
|
+
export function getRegisteredContentScripts<
|
|
184
|
+
F extends (scripts: RegisteredContentScript[]) => void
|
|
185
|
+
>(callback: ExtensionCallback<F>): void
|
|
186
|
+
export function unregisterContentScripts<F extends () => void>(
|
|
187
|
+
callback: ExtensionCallback<F>
|
|
188
|
+
): void
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
declare namespace browser.sessions {
|
|
192
|
+
export function getRecentlyClosed<F extends (sessions: Session[]) => void>(
|
|
193
|
+
callback: ExtensionCallback<F>
|
|
194
|
+
): void
|
|
195
|
+
export function getDevices<F extends (devices: Device[]) => void>(
|
|
196
|
+
callback: ExtensionCallback<F>
|
|
197
|
+
): void
|
|
198
|
+
export function restore<F extends (restoredSession: Session) => void>(
|
|
199
|
+
callback: ExtensionCallback<F>
|
|
200
|
+
): void
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
declare namespace browser.sockets.tcp {
|
|
204
|
+
export function create<F extends (createInfo: CreateInfo) => void>(
|
|
205
|
+
callback: ExtensionCallback<F>
|
|
206
|
+
): void
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
declare namespace browser.sockets.tcpServer {
|
|
210
|
+
export function create<F extends (createInfo: CreateInfo) => void>(
|
|
211
|
+
callback: ExtensionCallback<F>
|
|
212
|
+
): void
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
declare namespace browser.sockets.udp {
|
|
216
|
+
export function create<F extends (createInfo: CreateInfo) => void>(
|
|
217
|
+
callback: ExtensionCallback<F>
|
|
218
|
+
): void
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
declare namespace browser.system.display {
|
|
222
|
+
export function getInfo<F extends (displayInfo: DisplayUnitInfo[]) => void>(
|
|
223
|
+
callback: ExtensionCallback<F>
|
|
224
|
+
): void
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
declare namespace browser.tabCapture {
|
|
228
|
+
export function getMediaStreamId<F extends (streamId: string) => void>(
|
|
229
|
+
callback: ExtensionCallback<F>
|
|
230
|
+
): void
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
declare namespace browser.tabs {
|
|
234
|
+
export function sendMessage<F extends (response: any) => void>(
|
|
235
|
+
tabId: number,
|
|
236
|
+
message: any,
|
|
237
|
+
callback: ExtensionCallback<F>
|
|
238
|
+
): void
|
|
239
|
+
export function reload<F extends () => void>(
|
|
240
|
+
callback: ExtensionCallback<F>
|
|
241
|
+
): void
|
|
242
|
+
export function reload<F extends () => void>(
|
|
243
|
+
tabId: number,
|
|
244
|
+
callback: ExtensionCallback<F>
|
|
245
|
+
): void
|
|
246
|
+
export function reload<F extends () => void>(
|
|
247
|
+
reloadProperties: {bypassCache?: boolean},
|
|
248
|
+
callback: ExtensionCallback<F>
|
|
249
|
+
): void
|
|
250
|
+
export function detectLanguage<F extends (language: string) => void>(
|
|
251
|
+
callback: ExtensionCallback<F>
|
|
252
|
+
): void
|
|
253
|
+
export function captureVisibleTab<F extends (dataUrl: string) => void>(
|
|
254
|
+
callback: ExtensionCallback<F>
|
|
255
|
+
): void
|
|
256
|
+
export function captureVisibleTab<F extends (dataUrl: string) => void>(
|
|
257
|
+
windowId: number,
|
|
258
|
+
callback: ExtensionCallback<F>
|
|
259
|
+
): void
|
|
260
|
+
export function captureVisibleTab<F extends (dataUrl: string) => void>(
|
|
261
|
+
options: extensionTypes.ImageDetails,
|
|
262
|
+
callback: ExtensionCallback<F>
|
|
263
|
+
): void
|
|
264
|
+
export function getZoom<F extends (zoomFactor: number) => void>(
|
|
265
|
+
callback: ExtensionCallback<F>
|
|
266
|
+
): void
|
|
267
|
+
export function getZoomSettings<
|
|
268
|
+
F extends (zoomSettings: ZoomSettings) => void
|
|
269
|
+
>(callback: ExtensionCallback<F>): void
|
|
270
|
+
export function discard<F extends (tab?: Tab) => void>(
|
|
271
|
+
callback: ExtensionCallback<F>
|
|
272
|
+
): void
|
|
273
|
+
export function goForward<F extends () => void>(
|
|
274
|
+
callback: ExtensionCallback<F>
|
|
275
|
+
): void
|
|
276
|
+
export function goBack<F extends () => void>(
|
|
277
|
+
callback: ExtensionCallback<F>
|
|
278
|
+
): void
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
declare namespace browser.tts {
|
|
282
|
+
export function speak<F extends () => void>(
|
|
283
|
+
utterance: string,
|
|
284
|
+
callback: ExtensionCallback<F>
|
|
285
|
+
): void
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
declare namespace browser.userScripts {
|
|
289
|
+
export function getScripts<
|
|
290
|
+
F extends (scripts: RegisteredUserScript[]) => void
|
|
291
|
+
>(callback: ExtensionCallback<F>): void
|
|
292
|
+
export function unregister<F extends () => void>(
|
|
293
|
+
callback: ExtensionCallback<F>
|
|
294
|
+
): void
|
|
295
|
+
export function resetWorldConfiguration<F extends () => void>(
|
|
296
|
+
callback: ExtensionCallback<F>
|
|
297
|
+
): void
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
declare namespace browser.windows {
|
|
301
|
+
export function get<F extends (window: Window) => void>(
|
|
302
|
+
windowId: number,
|
|
303
|
+
callback: ExtensionCallback<F>
|
|
304
|
+
): void
|
|
305
|
+
export function getCurrent<F extends (window: Window) => void>(
|
|
306
|
+
callback: ExtensionCallback<F>
|
|
307
|
+
): void
|
|
308
|
+
export function getLastFocused<F extends (window: Window) => void>(
|
|
309
|
+
callback: ExtensionCallback<F>
|
|
310
|
+
): void
|
|
311
|
+
export function getAll<F extends (windows: Window[]) => void>(
|
|
312
|
+
callback: ExtensionCallback<F>
|
|
313
|
+
): void
|
|
314
|
+
export function create<F extends (window?: Window) => void>(
|
|
315
|
+
callback: ExtensionCallback<F>
|
|
316
|
+
): void
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
declare namespace chrome.action {
|
|
320
|
+
export function isEnabled<F extends (isEnabled: boolean) => void>(
|
|
321
|
+
callback: ExtensionCallback<F>
|
|
322
|
+
): void
|
|
323
|
+
export function openPopup<F extends () => void>(
|
|
324
|
+
callback: ExtensionCallback<F>
|
|
325
|
+
): void
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
declare namespace chrome.alarms {
|
|
329
|
+
export function get<F extends (alarm?: Alarm) => void>(
|
|
330
|
+
callback: ExtensionCallback<F>
|
|
331
|
+
): void
|
|
332
|
+
export function clear<F extends (wasCleared: boolean) => void>(
|
|
333
|
+
callback: ExtensionCallback<F>
|
|
334
|
+
): void
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
declare namespace chrome.audio {
|
|
338
|
+
export function getDevices<F extends (devices: AudioDeviceInfo[]) => void>(
|
|
339
|
+
callback: ExtensionCallback<F>
|
|
340
|
+
): void
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
declare namespace chrome._debugger {
|
|
344
|
+
export function sendCommand<
|
|
345
|
+
F extends (result?: {[name: string]: any}) => void
|
|
346
|
+
>(
|
|
347
|
+
target: DebuggerSession,
|
|
348
|
+
method: string,
|
|
349
|
+
callback: ExtensionCallback<F>
|
|
350
|
+
): void
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
declare namespace chrome.declarativeNetRequest {
|
|
354
|
+
export function getDynamicRules<F extends (rules: Rule[]) => void>(
|
|
355
|
+
callback: ExtensionCallback<F>
|
|
356
|
+
): void
|
|
357
|
+
export function getSessionRules<F extends (rules: Rule[]) => void>(
|
|
358
|
+
callback: ExtensionCallback<F>
|
|
359
|
+
): void
|
|
360
|
+
export function getMatchedRules<
|
|
361
|
+
F extends (details: RulesMatchedDetails) => void
|
|
362
|
+
>(callback: ExtensionCallback<F>): void
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
declare namespace chrome.devtools.inspectedWindow {
|
|
366
|
+
export function _eval<T = unknown>(
|
|
367
|
+
expression: string,
|
|
368
|
+
callback: (
|
|
369
|
+
result: T,
|
|
370
|
+
exceptionInfo: {
|
|
371
|
+
isError: boolean
|
|
372
|
+
code: string
|
|
373
|
+
description: string
|
|
374
|
+
details: any[]
|
|
375
|
+
isException: boolean
|
|
376
|
+
value: string
|
|
377
|
+
}
|
|
378
|
+
) => void
|
|
379
|
+
): void
|
|
380
|
+
export function _eval<T = unknown>(
|
|
381
|
+
expression: string,
|
|
382
|
+
options: {
|
|
383
|
+
frameURL?: string
|
|
384
|
+
useContentScriptContext?: boolean
|
|
385
|
+
scriptExecutionContext?: string
|
|
386
|
+
},
|
|
387
|
+
callback: (
|
|
388
|
+
result: T,
|
|
389
|
+
exceptionInfo: {
|
|
390
|
+
isError: boolean
|
|
391
|
+
code: string
|
|
392
|
+
description: string
|
|
393
|
+
details: any[]
|
|
394
|
+
isException: boolean
|
|
395
|
+
value: string
|
|
396
|
+
}
|
|
397
|
+
) => void
|
|
398
|
+
): void
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
declare namespace chrome.devtools.panels {
|
|
402
|
+
export function openResource<F extends () => void>(
|
|
403
|
+
url: string,
|
|
404
|
+
lineNumber: number,
|
|
405
|
+
callback: ExtensionCallback<F>
|
|
406
|
+
): void
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
declare namespace chrome.downloads {
|
|
410
|
+
export function getFileIcon<F extends (iconURL?: string) => void>(
|
|
411
|
+
downloadId: number,
|
|
412
|
+
callback: ExtensionCallback<F>
|
|
413
|
+
): void
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
declare namespace chrome.enterprise.platformKeys {
|
|
417
|
+
export function challengeMachineKey<
|
|
418
|
+
F extends (response: ArrayBuffer) => void
|
|
419
|
+
>(challenge: ArrayBuffer, callback: ExtensionCallback<F>): void
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
declare namespace chrome.fontSettings {
|
|
423
|
+
export function clearDefaultFontSize<F extends () => void>(
|
|
424
|
+
callback: ExtensionCallback<F>
|
|
425
|
+
): void
|
|
426
|
+
export function getDefaultFontSize<
|
|
427
|
+
F extends (details: {
|
|
428
|
+
pixelSize: number
|
|
429
|
+
levelOfControl: LevelOfControl
|
|
430
|
+
}) => void
|
|
431
|
+
>(callback: ExtensionCallback<F>): void
|
|
432
|
+
export function clearDefaultFixedFontSize<F extends () => void>(
|
|
433
|
+
callback: ExtensionCallback<F>
|
|
434
|
+
): void
|
|
435
|
+
export function getDefaultFixedFontSize<
|
|
436
|
+
F extends (details: {
|
|
437
|
+
pixelSize: number
|
|
438
|
+
levelOfControl: LevelOfControl
|
|
439
|
+
}) => void
|
|
440
|
+
>(callback: ExtensionCallback<F>): void
|
|
441
|
+
export function clearMinimumFontSize<F extends () => void>(
|
|
442
|
+
callback: ExtensionCallback<F>
|
|
443
|
+
): void
|
|
444
|
+
export function getMinimumFontSize<
|
|
445
|
+
F extends (details: {
|
|
446
|
+
pixelSize: number
|
|
447
|
+
levelOfControl: LevelOfControl
|
|
448
|
+
}) => void
|
|
449
|
+
>(callback: ExtensionCallback<F>): void
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
declare namespace chrome.identity {
|
|
453
|
+
export function getAuthToken<F extends (result: GetAuthTokenResult) => void>(
|
|
454
|
+
callback: ExtensionCallback<F>
|
|
455
|
+
): void
|
|
456
|
+
export function getProfileUserInfo<
|
|
457
|
+
F extends (userInfo: ProfileUserInfo) => void
|
|
458
|
+
>(callback: ExtensionCallback<F>): void
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
declare namespace chrome.management {
|
|
462
|
+
export function uninstall<F extends () => void>(
|
|
463
|
+
id: string,
|
|
464
|
+
callback: ExtensionCallback<F>
|
|
465
|
+
): void
|
|
466
|
+
export function uninstallSelf<F extends () => void>(
|
|
467
|
+
callback: ExtensionCallback<F>
|
|
468
|
+
): void
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
declare namespace chrome.runtime {
|
|
472
|
+
export function sendMessage<F extends (response: any) => void>(
|
|
473
|
+
extensionId: string,
|
|
474
|
+
message: any,
|
|
475
|
+
callback: ExtensionCallback<F>
|
|
476
|
+
): void
|
|
477
|
+
export function sendMessage<F extends (response: any) => void>(
|
|
478
|
+
message: any,
|
|
479
|
+
callback: ExtensionCallback<F>
|
|
480
|
+
): void
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
declare namespace chrome.scripting {
|
|
484
|
+
export function getRegisteredContentScripts<
|
|
485
|
+
F extends (scripts: RegisteredContentScript[]) => void
|
|
486
|
+
>(callback: ExtensionCallback<F>): void
|
|
487
|
+
export function unregisterContentScripts<F extends () => void>(
|
|
488
|
+
callback: ExtensionCallback<F>
|
|
489
|
+
): void
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
declare namespace chrome.sessions {
|
|
493
|
+
export function getRecentlyClosed<F extends (sessions: Session[]) => void>(
|
|
494
|
+
callback: ExtensionCallback<F>
|
|
495
|
+
): void
|
|
496
|
+
export function getDevices<F extends (devices: Device[]) => void>(
|
|
497
|
+
callback: ExtensionCallback<F>
|
|
498
|
+
): void
|
|
499
|
+
export function restore<F extends (restoredSession: Session) => void>(
|
|
500
|
+
callback: ExtensionCallback<F>
|
|
501
|
+
): void
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
declare namespace chrome.system.display {
|
|
505
|
+
export function getInfo<F extends (displayInfo: DisplayUnitInfo[]) => void>(
|
|
506
|
+
callback: ExtensionCallback<F>
|
|
507
|
+
): void
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
declare namespace chrome.tabCapture {
|
|
511
|
+
export function getMediaStreamId<F extends (streamId: string) => void>(
|
|
512
|
+
callback: ExtensionCallback<F>
|
|
513
|
+
): void
|
|
514
|
+
}
|
|
515
|
+
|
|
516
|
+
declare namespace chrome.tabs {
|
|
517
|
+
export function sendMessage<F extends (response: any) => void>(
|
|
518
|
+
tabId: number,
|
|
519
|
+
message: any,
|
|
520
|
+
callback: ExtensionCallback<F>
|
|
521
|
+
): void
|
|
522
|
+
export function reload<F extends () => void>(
|
|
523
|
+
callback: ExtensionCallback<F>
|
|
524
|
+
): void
|
|
525
|
+
export function reload<F extends () => void>(
|
|
526
|
+
tabId: number,
|
|
527
|
+
callback: ExtensionCallback<F>
|
|
528
|
+
): void
|
|
529
|
+
export function reload<F extends () => void>(
|
|
530
|
+
reloadProperties: {bypassCache?: boolean},
|
|
531
|
+
callback: ExtensionCallback<F>
|
|
532
|
+
): void
|
|
533
|
+
export function detectLanguage<F extends (language: string) => void>(
|
|
534
|
+
callback: ExtensionCallback<F>
|
|
535
|
+
): void
|
|
536
|
+
export function captureVisibleTab<F extends (dataUrl: string) => void>(
|
|
537
|
+
callback: ExtensionCallback<F>
|
|
538
|
+
): void
|
|
539
|
+
export function captureVisibleTab<F extends (dataUrl: string) => void>(
|
|
540
|
+
windowId: number,
|
|
541
|
+
callback: ExtensionCallback<F>
|
|
542
|
+
): void
|
|
543
|
+
export function captureVisibleTab<F extends (dataUrl: string) => void>(
|
|
544
|
+
options: extensionTypes.ImageDetails,
|
|
545
|
+
callback: ExtensionCallback<F>
|
|
546
|
+
): void
|
|
547
|
+
export function getZoom<F extends (zoomFactor: number) => void>(
|
|
548
|
+
callback: ExtensionCallback<F>
|
|
549
|
+
): void
|
|
550
|
+
export function getZoomSettings<
|
|
551
|
+
F extends (zoomSettings: ZoomSettings) => void
|
|
552
|
+
>(callback: ExtensionCallback<F>): void
|
|
553
|
+
export function discard<F extends (tab?: Tab) => void>(
|
|
554
|
+
callback: ExtensionCallback<F>
|
|
555
|
+
): void
|
|
556
|
+
export function goForward<F extends () => void>(
|
|
557
|
+
callback: ExtensionCallback<F>
|
|
558
|
+
): void
|
|
559
|
+
export function goBack<F extends () => void>(
|
|
560
|
+
callback: ExtensionCallback<F>
|
|
561
|
+
): void
|
|
562
|
+
}
|
|
563
|
+
|
|
564
|
+
declare namespace chrome.tts {
|
|
565
|
+
export function speak<F extends () => void>(
|
|
566
|
+
utterance: string,
|
|
567
|
+
callback: ExtensionCallback<F>
|
|
568
|
+
): void
|
|
569
|
+
}
|
|
570
|
+
|
|
571
|
+
declare namespace chrome.userScripts {
|
|
572
|
+
export function resetWorldConfiguration<F extends () => void>(
|
|
573
|
+
callback: ExtensionCallback<F>
|
|
574
|
+
): void
|
|
575
|
+
}
|
|
576
|
+
|
|
577
|
+
declare namespace chrome.windows {
|
|
578
|
+
export function get<F extends (window: Window) => void>(
|
|
579
|
+
windowId: number,
|
|
580
|
+
callback: ExtensionCallback<F>
|
|
581
|
+
): void
|
|
582
|
+
export function getCurrent<F extends (window: Window) => void>(
|
|
583
|
+
callback: ExtensionCallback<F>
|
|
584
|
+
): void
|
|
585
|
+
export function getLastFocused<F extends (window: Window) => void>(
|
|
586
|
+
callback: ExtensionCallback<F>
|
|
587
|
+
): void
|
|
588
|
+
export function getAll<F extends (windows: Window[]) => void>(
|
|
589
|
+
callback: ExtensionCallback<F>
|
|
590
|
+
): void
|
|
591
|
+
export function create<F extends (window?: Window) => void>(
|
|
592
|
+
callback: ExtensionCallback<F>
|
|
593
|
+
): void
|
|
594
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
// What chrome-types leaves out for code the browser accepts.
|
|
2
|
+
// These merge into the namespaces chrome-types owns.
|
|
3
|
+
/// <reference types="chrome-types" />
|
|
4
|
+
|
|
5
|
+
declare namespace browser.events {
|
|
6
|
+
// A function with no return statement is typed void, and at run time it
|
|
7
|
+
// returns undefined, which these events take.
|
|
8
|
+
// biome-ignore lint/suspicious/noExplicitAny: has to repeat the chrome-types parameter to merge
|
|
9
|
+
export interface Event<H extends (...args: any) => void, C = void, A = void> {
|
|
10
|
+
addListener(
|
|
11
|
+
callback: undefined extends ReturnType<H>
|
|
12
|
+
? (...args: Parameters<H>) => void
|
|
13
|
+
: H
|
|
14
|
+
): void
|
|
15
|
+
removeListener(
|
|
16
|
+
callback: undefined extends ReturnType<H>
|
|
17
|
+
? (...args: Parameters<H>) => void
|
|
18
|
+
: H
|
|
19
|
+
): void
|
|
20
|
+
hasListener(
|
|
21
|
+
callback: undefined extends ReturnType<H>
|
|
22
|
+
? (...args: Parameters<H>) => void
|
|
23
|
+
: H
|
|
24
|
+
): boolean
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
declare namespace browser.tabs {
|
|
29
|
+
/**
|
|
30
|
+
* What changed in a tab, the second argument of an `onUpdated` listener.
|
|
31
|
+
*/
|
|
32
|
+
export type OnUpdatedInfo =
|
|
33
|
+
typeof onUpdated extends events.Event<infer H> ? Parameters<H>[1] : never
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* The name older @types/chrome releases gave `OnUpdatedInfo`.
|
|
37
|
+
*/
|
|
38
|
+
export type TabChangeInfo = OnUpdatedInfo
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
declare namespace chrome.tabs {
|
|
42
|
+
export import OnUpdatedInfo = browser.tabs.OnUpdatedInfo
|
|
43
|
+
export import TabChangeInfo = browser.tabs.TabChangeInfo
|
|
44
|
+
}
|