@types/chrome 0.0.170 → 0.0.174

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.
chrome/README.md CHANGED
@@ -8,9 +8,9 @@ This package contains type definitions for Chrome extension development (http://
8
8
  Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/chrome.
9
9
 
10
10
  ### Additional Details
11
- * Last updated: Sun, 12 Dec 2021 06:31:08 GMT
11
+ * Last updated: Wed, 29 Dec 2021 14:31:25 GMT
12
12
  * Dependencies: [@types/filesystem](https://npmjs.com/package/@types/filesystem), [@types/har-format](https://npmjs.com/package/@types/har-format)
13
13
  * Global values: `chrome`
14
14
 
15
15
  # Credits
16
- These definitions were written by [Matthew Kimber](https://github.com/matthewkimber), [otiai10](https://github.com/otiai10), [couven92](https://github.com/couven92), [RReverser](https://github.com/rreverser), [sreimer15](https://github.com/sreimer15), [MatCarlson](https://github.com/MatCarlson), [ekinsol](https://github.com/ekinsol), [Thierry Régagnon](https://github.com/tregagnon), [Brian Wilson](https://github.com/echoabstract), [Sebastiaan Pasma](https://github.com/spasma), [bdbai](https://github.com/bdbai), [pokutuna](https://github.com/pokutuna), [Jason Xian](https://github.com/JasonXian), [userTim](https://github.com/usertim), [Idan Zeierman](https://github.com/idan315), [Nicolas Rodriguez](https://github.com/nicolas377), and [Ido Salomon](https://github.com/idosal).
16
+ These definitions were written by [Matthew Kimber](https://github.com/matthewkimber), [otiai10](https://github.com/otiai10), [RReverser](https://github.com/rreverser), [sreimer15](https://github.com/sreimer15), [MatCarlson](https://github.com/MatCarlson), [ekinsol](https://github.com/ekinsol), [Thierry Régagnon](https://github.com/tregagnon), [Brian Wilson](https://github.com/echoabstract), [Sebastiaan Pasma](https://github.com/spasma), [bdbai](https://github.com/bdbai), [pokutuna](https://github.com/pokutuna), [Jason Xian](https://github.com/JasonXian), [userTim](https://github.com/usertim), [Idan Zeierman](https://github.com/idan315), [Nicolas Rodriguez](https://github.com/nicolas377), and [Ido Salomon](https://github.com/idosal).
@@ -10,7 +10,6 @@
10
10
  ////////////////////
11
11
  declare namespace chrome.cast {
12
12
  /**
13
- * @enum {string}
14
13
  * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast#.AutoJoinPolicy
15
14
  */
16
15
  export enum AutoJoinPolicy {
@@ -21,7 +20,6 @@ declare namespace chrome.cast {
21
20
  }
22
21
 
23
22
  /**
24
- * @enum {string}
25
23
  * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast#.DefaultActionPolicy
26
24
  */
27
25
  export enum DefaultActionPolicy {
@@ -30,7 +28,6 @@ declare namespace chrome.cast {
30
28
  }
31
29
 
32
30
  /**
33
- * @enum {string}
34
31
  * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast#.Capability
35
32
  */
36
33
  export enum Capability {
@@ -42,7 +39,6 @@ declare namespace chrome.cast {
42
39
  }
43
40
 
44
41
  /**
45
- * @enum {string}
46
42
  * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast#.ErrorCode
47
43
  */
48
44
  export enum ErrorCode {
@@ -59,7 +55,6 @@ declare namespace chrome.cast {
59
55
  }
60
56
 
61
57
  /**
62
- * @enum {string}
63
58
  * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast#.ReceiverAvailability
64
59
  */
65
60
  export enum ReceiverAvailability {
@@ -68,7 +63,6 @@ declare namespace chrome.cast {
68
63
  }
69
64
 
70
65
  /**
71
- * @enum {string}
72
66
  * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast#.SenderPlatform
73
67
  */
74
68
  export enum SenderPlatform {
@@ -78,7 +72,6 @@ declare namespace chrome.cast {
78
72
  }
79
73
 
80
74
  /**
81
- * @enum {string}
82
75
  * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast#.ReceiverType
83
76
  */
84
77
  export enum ReceiverType {
@@ -89,7 +82,6 @@ declare namespace chrome.cast {
89
82
  }
90
83
 
91
84
  /**
92
- * @enum {string}
93
85
  * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast#.ReceiverAction
94
86
  */
95
87
  export enum ReceiverAction {
@@ -98,7 +90,6 @@ declare namespace chrome.cast {
98
90
  }
99
91
 
100
92
  /**
101
- * @enum {string}
102
93
  * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast#.SessionStatus
103
94
  */
104
95
  export enum SessionStatus {
@@ -114,15 +105,14 @@ declare namespace chrome.cast {
114
105
  export var VERSION: Array<number>;
115
106
 
116
107
  /**
117
- * @type {boolean}
118
108
  * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast#.isAvailable
119
109
  */
120
110
  export var isAvailable: boolean;
121
111
 
122
112
  /**
123
- * @param {!chrome.cast.ApiConfig} apiConfig
124
- * @param {function()} successCallback
125
- * @param {function(chrome.cast.Error)} errorCallback
113
+ * @param apiConfig
114
+ * @param successCallback
115
+ * @param errorCallback
126
116
  */
127
117
  export function initialize(
128
118
  apiConfig: chrome.cast.ApiConfig,
@@ -131,10 +121,10 @@ declare namespace chrome.cast {
131
121
  ): void;
132
122
 
133
123
  /**
134
- * @param {function(!chrome.cast.Session)} successCallback
135
- * @param {function(chrome.cast.Error)} errorCallback
136
- * @param {chrome.cast.SessionRequest=} opt_sessionRequest
137
- * @param {string=} opt_label
124
+ * @param successCallback
125
+ * @param errorCallback
126
+ * @param opt_sessionRequest
127
+ * @param opt_label
138
128
  */
139
129
  export function requestSession(
140
130
  successCallback: (session: chrome.cast.Session) => void,
@@ -144,33 +134,33 @@ declare namespace chrome.cast {
144
134
  ): void;
145
135
 
146
136
  /**
147
- * @param {string} sessionId The id of the session to join.
137
+ * @param sessionId The id of the session to join.
148
138
  */
149
139
  export function requestSessionById(sessionId: string): void;
150
140
 
151
141
  /**
152
- * @param {chrome.cast.ReceiverActionListener} listener
142
+ * @param listener
153
143
  */
154
144
  export function addReceiverActionListener(
155
145
  listener: (receiver: chrome.cast.Receiver, receiverAction: chrome.cast.ReceiverAction) => void,
156
146
  ): void;
157
147
 
158
148
  /**
159
- * @param {chrome.cast.ReceiverActionListener} listener
149
+ * @param listener
160
150
  */
161
151
  export function removeReceiverActionListener(
162
152
  listener: (receiver: chrome.cast.Receiver, receiverAction: chrome.cast.ReceiverAction) => void,
163
153
  ): void;
164
154
 
165
155
  /**
166
- * @param {string} message The message to log.
156
+ * @param message The message to log.
167
157
  */
168
158
  export function logMessage(message: string): void;
169
159
 
170
160
  /**
171
- * @param {!Array<chrome.cast.Receiver>} receivers
172
- * @param {function()} successCallback
173
- * @param {function(chrome.cast.Error)} errorCallback
161
+ * @param receivers
162
+ * @param successCallback
163
+ * @param errorCallback
174
164
  */
175
165
  export function setCustomReceivers(
176
166
  receivers: Array<chrome.cast.Receiver>,
@@ -179,9 +169,9 @@ declare namespace chrome.cast {
179
169
  ): void;
180
170
 
181
171
  /**
182
- * @param {!chrome.cast.Receiver} receiver
183
- * @param {function()} successCallback
184
- * @param {function(chrome.cast.Error)} errorCallback
172
+ * @param receiver
173
+ * @param successCallback
174
+ * @param errorCallback
185
175
  */
186
176
  export function setReceiverDisplayStatus(
187
177
  receiver: chrome.cast.Receiver,
@@ -190,20 +180,18 @@ declare namespace chrome.cast {
190
180
  ): void;
191
181
 
192
182
  /**
193
- * @param {string} escaped A string to unescape.
183
+ * @param escaped A string to unescape.
194
184
  * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast#.unescape
195
185
  */
196
186
  export function unescape(escaped: string): string;
197
187
 
198
188
  export class ApiConfig {
199
189
  /**
200
- * @param {!chrome.cast.SessionRequest} sessionRequest
201
- * @param {function(!chrome.cast.Session)} sessionListener
202
- * @param {function(!chrome.cast.ReceiverAvailability,Array<Object>)}
203
- * receiverListener
204
- * @param {chrome.cast.AutoJoinPolicy=} opt_autoJoinPolicy
205
- * @param {chrome.cast.DefaultActionPolicy=} opt_defaultActionPolicy
206
- * @constructor
190
+ * @param sessionRequest
191
+ * @param sessionListener
192
+ * @param receiverListener
193
+ * @param opt_autoJoinPolicy
194
+ * @param opt_defaultActionPolicy
207
195
  * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.ApiConfig
208
196
  */
209
197
  constructor(
@@ -223,10 +211,9 @@ declare namespace chrome.cast {
223
211
 
224
212
  export class Error {
225
213
  /**
226
- * @param {!chrome.cast.ErrorCode} code
227
- * @param {string=} opt_description
228
- * @param {Object=} opt_details
229
- * @constructor
214
+ * @param code
215
+ * @param opt_description
216
+ * @param opt_details
230
217
  * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.Error
231
218
  */
232
219
  constructor(code: chrome.cast.ErrorCode, description?: string, details?: Object);
@@ -238,8 +225,7 @@ declare namespace chrome.cast {
238
225
 
239
226
  export class Image {
240
227
  /**
241
- * @param {string} url
242
- * @constructor
228
+ * @param url
243
229
  * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.Image
244
230
  */
245
231
  constructor(url: string);
@@ -251,8 +237,7 @@ declare namespace chrome.cast {
251
237
 
252
238
  export class SenderApplication {
253
239
  /**
254
- * @param {!chrome.cast.SenderPlatform} platform
255
- * @constructor
240
+ * @param platform
256
241
  * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.SenderApplication
257
242
  */
258
243
  constructor(platform: chrome.cast.SenderPlatform);
@@ -264,10 +249,9 @@ declare namespace chrome.cast {
264
249
 
265
250
  export class SessionRequest {
266
251
  /**
267
- * @param {string} appId
268
- * @param {!Array<chrome.cast.Capability>=} opt_capabilities
269
- * @param {number=} opt_timeout
270
- * @constructor
252
+ * @param appId
253
+ * @param opt_capabilities
254
+ * @param opt_timeout
271
255
  * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.SessionRequest
272
256
  */
273
257
  constructor(appId: string, capabilities?: Array<chrome.cast.Capability>, timeout?: number);
@@ -280,12 +264,11 @@ declare namespace chrome.cast {
280
264
 
281
265
  export class Session {
282
266
  /**
283
- * @param {string} sessionId
284
- * @param {string} appId
285
- * @param {string} displayName
286
- * @param {!Array<chrome.cast.Image>} appImages
287
- * @param {!chrome.cast.Receiver} receiver
288
- * @constructor
267
+ * @param sessionId
268
+ * @param appId
269
+ * @param displayName
270
+ * @param appImages
271
+ * @param receiver
289
272
  * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.Session
290
273
  */
291
274
  constructor(
@@ -309,9 +292,9 @@ declare namespace chrome.cast {
309
292
  transportId: string;
310
293
 
311
294
  /**
312
- * @param {number} newLevel
313
- * @param {function()} successCallback
314
- * @param {function(chrome.cast.Error)} errorCallback
295
+ * @param newLevel
296
+ * @param successCallback
297
+ * @param errorCallback
315
298
  */
316
299
  setReceiverVolumeLevel(
317
300
  newLevel: number,
@@ -320,9 +303,9 @@ declare namespace chrome.cast {
320
303
  ): void;
321
304
 
322
305
  /**
323
- * @param {boolean} muted
324
- * @param {function()} successCallback
325
- * @param {function(chrome.cast.Error)} errorCallback
306
+ * @param muted
307
+ * @param successCallback
308
+ * @param errorCallback
326
309
  */
327
310
  setReceiverMuted(
328
311
  muted: boolean,
@@ -331,22 +314,22 @@ declare namespace chrome.cast {
331
314
  ): void;
332
315
 
333
316
  /**
334
- * @param {function()} successCallback
335
- * @param {function(chrome.cast.Error)} errorCallback
317
+ * @param successCallback
318
+ * @param errorCallback
336
319
  */
337
320
  leave(successCallback: Function, errorCallback: (error: chrome.cast.Error) => void): void;
338
321
 
339
322
  /**
340
- * @param {function()} successCallback
341
- * @param {function(chrome.cast.Error)} errorCallback
323
+ * @param successCallback
324
+ * @param errorCallback
342
325
  */
343
326
  stop(successCallback: Function, errorCallback: (error: chrome.cast.Error) => void): void;
344
327
 
345
328
  /**
346
- * @param {string} namespace
347
- * @param {!Object|string} message
348
- * @param {!function()} successCallback
349
- * @param {function(!chrome.cast.Error)} errorCallback
329
+ * @param namespace
330
+ * @param message
331
+ * @param successCallback
332
+ * @param errorCallback
350
333
  */
351
334
  sendMessage(
352
335
  namespace: string,
@@ -356,41 +339,41 @@ declare namespace chrome.cast {
356
339
  ): void;
357
340
 
358
341
  /**
359
- * @param {function(boolean)} listener
342
+ * @param listener
360
343
  */
361
344
  addUpdateListener(listener: (isAlive: boolean) => void): void;
362
345
 
363
346
  /**
364
- * @param {function(boolean)} listener
347
+ * @param listener
365
348
  */
366
349
  removeUpdateListener(listener: (isAlive: boolean) => void): void;
367
350
 
368
351
  /**
369
- * @param {string} namespace
370
- * @param {function(string,string)} listener
352
+ * @param namespace
353
+ * @param listener
371
354
  */
372
355
  addMessageListener(namespace: string, listener: (namespace: string, message: string) => void): void;
373
356
 
374
357
  /**
375
- * @param {string} namespace
376
- * @param {function(string,string)} listener
358
+ * @param namespace
359
+ * @param listener
377
360
  */
378
361
  removeMessageListener(namespace: string, listener: (namespace: string, message: string) => void): void;
379
362
 
380
363
  /**
381
- * @param {function(!chrome.cast.media.Media)} listener
364
+ * @param listener
382
365
  */
383
366
  addMediaListener(listener: (media: chrome.cast.media.Media) => void): void;
384
367
 
385
368
  /**
386
- * @param {function(!chrome.cast.media.Media)} listener
369
+ * @param listener
387
370
  */
388
371
  removeMediaListener(listener: (media: chrome.cast.media.Media) => void): void;
389
372
 
390
373
  /**
391
- * @param {!chrome.cast.media.LoadRequest} loadRequest
392
- * @param {function(!chrome.cast.media.Media)} successCallback
393
- * @param {function(!chrome.cast.Error)} errorCallback
374
+ * @param loadRequest
375
+ * @param successCallback
376
+ * @param errorCallback
394
377
  */
395
378
  loadMedia(
396
379
  loadRequest: chrome.cast.media.LoadRequest,
@@ -399,9 +382,9 @@ declare namespace chrome.cast {
399
382
  ): void;
400
383
 
401
384
  /**
402
- * @param {!chrome.cast.media.QueueLoadRequest} queueLoadRequest
403
- * @param {function(!chrome.cast.media.Media)} successCallback
404
- * @param {function(!chrome.cast.Error)} errorCallback
385
+ * @param queueLoadRequest
386
+ * @param successCallback
387
+ * @param errorCallback
405
388
  */
406
389
  queueLoad(
407
390
  queueLoadRequest: chrome.cast.media.QueueLoadRequest,
@@ -412,11 +395,10 @@ declare namespace chrome.cast {
412
395
 
413
396
  export class Receiver {
414
397
  /**
415
- * @param {string} label
416
- * @param {string} friendlyName
417
- * @param {Array<chrome.cast.Capability>=} opt_capabilities
418
- * @param {chrome.cast.Volume=} opt_volume
419
- * @constructor
398
+ * @param label
399
+ * @param friendlyName
400
+ * @param opt_capabilities
401
+ * @param opt_volume
420
402
  * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.Receiver
421
403
  */
422
404
  constructor(
@@ -436,9 +418,8 @@ declare namespace chrome.cast {
436
418
 
437
419
  export class ReceiverDisplayStatus {
438
420
  /**
439
- * @param {string} statusText
440
- * @param {!Array<chrome.cast.Image>} appImages
441
- * @constructor
421
+ * @param statusText
422
+ * @param appImages
442
423
  * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.ReceiverDisplayStatus
443
424
  */
444
425
  constructor(statusText: string, appImages: Array<chrome.cast.Image>);
@@ -449,9 +430,8 @@ declare namespace chrome.cast {
449
430
 
450
431
  export class Volume {
451
432
  /**
452
- * @param {?number=} opt_level
453
- * @param {?boolean=} opt_muted
454
- * @constructor
433
+ * @param opt_level
434
+ * @param opt_muted
455
435
  * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.Volume
456
436
  */
457
437
  constructor(level?: number, muted?: boolean);
@@ -465,7 +445,6 @@ declare namespace chrome.cast.media {
465
445
  export var DEFAULT_MEDIA_RECEIVER_APP_ID: string;
466
446
 
467
447
  /**
468
- * @enum {string}
469
448
  * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media#.MediaCommand
470
449
  */
471
450
  export enum MediaCommand {
@@ -476,7 +455,6 @@ declare namespace chrome.cast.media {
476
455
  }
477
456
 
478
457
  /**
479
- * @enum {number}
480
458
  * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media#.MetadataType
481
459
  */
482
460
  export enum MetadataType {
@@ -488,7 +466,6 @@ declare namespace chrome.cast.media {
488
466
  }
489
467
 
490
468
  /**
491
- * @enum {string}
492
469
  * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media#.PlayerState
493
470
  */
494
471
  export enum PlayerState {
@@ -499,7 +476,6 @@ declare namespace chrome.cast.media {
499
476
  }
500
477
 
501
478
  /**
502
- * @enum {string}
503
479
  * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media#.ResumeState
504
480
  */
505
481
  export enum ResumeState {
@@ -508,7 +484,6 @@ declare namespace chrome.cast.media {
508
484
  }
509
485
 
510
486
  /**
511
- * @enum {string}
512
487
  * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media#.StreamType
513
488
  */
514
489
  export enum StreamType {
@@ -518,7 +493,6 @@ declare namespace chrome.cast.media {
518
493
  }
519
494
 
520
495
  /**
521
- * @enum {string}
522
496
  * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media#.IdleReason
523
497
  */
524
498
  export enum IdleReason {
@@ -529,7 +503,6 @@ declare namespace chrome.cast.media {
529
503
  }
530
504
 
531
505
  /**
532
- * @enum {string}
533
506
  * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media#.RepeatMode
534
507
  */
535
508
  export enum RepeatMode {
@@ -541,8 +514,7 @@ declare namespace chrome.cast.media {
541
514
 
542
515
  export class QueueItem {
543
516
  /**
544
- * @param {!chrome.cast.media.MediaInfo} mediaInfo
545
- * @constructor
517
+ * @param mediaInfo
546
518
  * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.QueueItem
547
519
  */
548
520
  constructor(mediaInfo: chrome.cast.media.MediaInfo);
@@ -558,8 +530,7 @@ declare namespace chrome.cast.media {
558
530
 
559
531
  export class QueueLoadRequest {
560
532
  /**
561
- * @param {!Array<chrome.cast.media.QueueItem>} items
562
- * @constructor
533
+ * @param items
563
534
  * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.QueueLoadRequest
564
535
  */
565
536
  constructor(items: Array<chrome.cast.media.QueueItem>);
@@ -572,8 +543,7 @@ declare namespace chrome.cast.media {
572
543
 
573
544
  export class QueueInsertItemsRequest {
574
545
  /**
575
- * @param {!Array<chrome.cast.media.QueueItem>}
576
- * @constructor
546
+ * @param itemsToInsert
577
547
  * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.QueueInsertItemsRequest
578
548
  */
579
549
  constructor(itemsToInsert: Array<chrome.cast.media.QueueItem>);
@@ -585,8 +555,7 @@ declare namespace chrome.cast.media {
585
555
 
586
556
  export class QueueRemoveItemsRequest {
587
557
  /**
588
- * @param {!Array<number>}
589
- * @constructor
558
+ * @param itemIdsToRemove
590
559
  * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.QueueRemoveItemsRequest
591
560
  */
592
561
  constructor(itemIdsToRemove: Array<number>);
@@ -597,8 +566,7 @@ declare namespace chrome.cast.media {
597
566
 
598
567
  export class QueueReorderItemsRequest {
599
568
  /**
600
- * @param {!Array<number>}
601
- * @constructor
569
+ * @param itemIdsToReorder
602
570
  * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.QueueReorderItemsRequest
603
571
  */
604
572
  constructor(itemIdsToReorder: Array<number>);
@@ -610,8 +578,7 @@ declare namespace chrome.cast.media {
610
578
 
611
579
  export class QueueUpdateItemsRequest {
612
580
  /**
613
- * @param {!Array<chrome.cast.media.QueueItem>}
614
- * @constructor
581
+ * @param itemsToUpdate
615
582
  * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.QueueUpdateItemsRequest
616
583
  */
617
584
  constructor(itemsToUpdate: Array<chrome.cast.media.QueueItem>);
@@ -621,7 +588,6 @@ declare namespace chrome.cast.media {
621
588
  }
622
589
 
623
590
  /**
624
- * @enum {string}
625
591
  * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media#.TrackType
626
592
  */
627
593
  export enum TrackType {
@@ -631,7 +597,6 @@ declare namespace chrome.cast.media {
631
597
  }
632
598
 
633
599
  /**
634
- * @enum {string}
635
600
  * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media#.TextTrackType
636
601
  */
637
602
  export enum TextTrackType {
@@ -643,7 +608,6 @@ declare namespace chrome.cast.media {
643
608
  }
644
609
 
645
610
  /**
646
- * @enum {string}
647
611
  * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media#.TextTrackEdgeType
648
612
  */
649
613
  export enum TextTrackEdgeType {
@@ -655,7 +619,6 @@ declare namespace chrome.cast.media {
655
619
  }
656
620
 
657
621
  /**
658
- * @enum {string}
659
622
  * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media#.TextTrackWindowType
660
623
  */
661
624
  export enum TextTrackWindowType {
@@ -665,7 +628,6 @@ declare namespace chrome.cast.media {
665
628
  }
666
629
 
667
630
  /**
668
- * @enum {string}
669
631
  * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media#.TextTrackFontGenericFamily
670
632
  */
671
633
  export enum TextTrackFontGenericFamily {
@@ -679,7 +641,6 @@ declare namespace chrome.cast.media {
679
641
  }
680
642
 
681
643
  /**
682
- * @enum {string}
683
644
  * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media#.TextTrackFontStyle
684
645
  */
685
646
  export enum TextTrackFontStyle {
@@ -691,7 +652,6 @@ declare namespace chrome.cast.media {
691
652
 
692
653
  export class GetStatusRequest {
693
654
  /**
694
- * @constructor
695
655
  * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.GetStatusRequest
696
656
  */
697
657
  constructor();
@@ -701,7 +661,6 @@ declare namespace chrome.cast.media {
701
661
 
702
662
  export class PauseRequest {
703
663
  /**
704
- * @constructor
705
664
  * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.PauseRequest
706
665
  */
707
666
  constructor();
@@ -711,7 +670,6 @@ declare namespace chrome.cast.media {
711
670
 
712
671
  export class PlayRequest {
713
672
  /**
714
- * @constructor
715
673
  * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.PlayRequest
716
674
  */
717
675
  constructor();
@@ -721,7 +679,6 @@ declare namespace chrome.cast.media {
721
679
 
722
680
  export class SeekRequest {
723
681
  /**
724
- * @constructor
725
682
  * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.SeekRequest
726
683
  */
727
684
  constructor();
@@ -733,7 +690,6 @@ declare namespace chrome.cast.media {
733
690
 
734
691
  export class StopRequest {
735
692
  /**
736
- * @constructor
737
693
  * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.StopRequest
738
694
  */
739
695
  constructor();
@@ -743,8 +699,7 @@ declare namespace chrome.cast.media {
743
699
 
744
700
  export class VolumeRequest {
745
701
  /**
746
- * @param {!chrome.cast.Volume} volume
747
- * @constructor
702
+ * @param volume
748
703
  * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.VolumeRequest
749
704
  */
750
705
  constructor(volume: chrome.cast.Volume);
@@ -755,8 +710,7 @@ declare namespace chrome.cast.media {
755
710
 
756
711
  export class LoadRequest {
757
712
  /**
758
- * @param {!chrome.cast.media.MediaInfo} mediaInfo
759
- * @constructor
713
+ * @param mediaInfo
760
714
  * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.LoadRequest
761
715
  */
762
716
  constructor(mediaInfo: chrome.cast.media.MediaInfo);
@@ -766,13 +720,13 @@ declare namespace chrome.cast.media {
766
720
  currentTime: number;
767
721
  customData: Object;
768
722
  media: chrome.cast.media.MediaInfo;
723
+ playbackRate?: number | undefined;
769
724
  }
770
725
 
771
726
  export class EditTracksInfoRequest {
772
727
  /**
773
- * @param {Array<number>=} opt_activeTrackIds
774
- * @param {chrome.cast.media.TextTrackStyle=} opt_textTrackStyle
775
- * @constructor
728
+ * @param opt_activeTrackIds
729
+ * @param opt_textTrackStyle
776
730
  * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.EditTracksInfoRequest
777
731
  */
778
732
  constructor(activeTrackIds?: Array<number>, textTrackStyle?: chrome.cast.media.TextTrackStyle);
@@ -795,7 +749,6 @@ declare namespace chrome.cast.media {
795
749
 
796
750
  export class MovieMediaMetadata {
797
751
  /**
798
- * @constructor
799
752
  * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.MovieMediaMetadata
800
753
  */
801
754
  constructor();
@@ -814,7 +767,6 @@ declare namespace chrome.cast.media {
814
767
 
815
768
  export class TvShowMediaMetadata {
816
769
  /**
817
- * @constructor
818
770
  * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.TvShowMediaMetadata
819
771
  */
820
772
  constructor();
@@ -841,7 +793,6 @@ declare namespace chrome.cast.media {
841
793
 
842
794
  export class MusicTrackMediaMetadata {
843
795
  /**
844
- * @constructor
845
796
  * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.MusicTrackMediaMetadata
846
797
  */
847
798
  constructor();
@@ -868,7 +819,6 @@ declare namespace chrome.cast.media {
868
819
 
869
820
  export class PhotoMediaMetadata {
870
821
  /**
871
- * @constructor
872
822
  * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.PhotoMediaMetadata
873
823
  */
874
824
  constructor();
@@ -890,9 +840,8 @@ declare namespace chrome.cast.media {
890
840
 
891
841
  export class MediaInfo {
892
842
  /**
893
- * @param {string} contentId
894
- * @param {string} contentType
895
- * @constructor
843
+ * @param contentId
844
+ * @param contentType
896
845
  * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.MediaInfo
897
846
  */
898
847
  constructor(contentId: string, contentType: string);
@@ -909,9 +858,8 @@ declare namespace chrome.cast.media {
909
858
 
910
859
  export class Media {
911
860
  /**
912
- * @param {string} sessionId
913
- * @param {number} mediaSessionId
914
- * @constructor
861
+ * @param sessionId
862
+ * @param mediaSessionId
915
863
  * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.Media
916
864
  */
917
865
  constructor(sessionId: string, mediaSessionId: number);
@@ -937,9 +885,9 @@ declare namespace chrome.cast.media {
937
885
  currentTime: number;
938
886
 
939
887
  /**
940
- * @param {chrome.cast.media.GetStatusRequest} getStatusRequest
941
- * @param {function()} successCallback
942
- * @param {function(!chrome.cast.Error)} errorCallback
888
+ * @param getStatusRequest
889
+ * @param successCallback
890
+ * @param errorCallback
943
891
  */
944
892
  getStatus(
945
893
  getStatusRequest: chrome.cast.media.GetStatusRequest,
@@ -948,9 +896,9 @@ declare namespace chrome.cast.media {
948
896
  ): void;
949
897
 
950
898
  /**
951
- * @param {chrome.cast.media.PlayRequest} playRequest
952
- * @param {function()} successCallback
953
- * @param {function(!chrome.cast.Error)} errorCallback
899
+ * @param playRequest
900
+ * @param successCallback
901
+ * @param errorCallback
954
902
  */
955
903
  play(
956
904
  playRequest: chrome.cast.media.PlayRequest,
@@ -959,9 +907,9 @@ declare namespace chrome.cast.media {
959
907
  ): void;
960
908
 
961
909
  /**
962
- * @param {chrome.cast.media.PauseRequest} pauseRequest
963
- * @param {function()} successCallback
964
- * @param {function(!chrome.cast.Error)} errorCallback
910
+ * @param pauseRequest
911
+ * @param successCallback
912
+ * @param errorCallback
965
913
  */
966
914
  pause(
967
915
  pauseRequest: chrome.cast.media.PauseRequest,
@@ -970,9 +918,9 @@ declare namespace chrome.cast.media {
970
918
  ): void;
971
919
 
972
920
  /**
973
- * @param {!chrome.cast.media.SeekRequest} seekRequest
974
- * @param {function()} successCallback
975
- * @param {function(!chrome.cast.Error)} errorCallback
921
+ * @param seekRequest
922
+ * @param successCallback
923
+ * @param errorCallback
976
924
  */
977
925
  seek(
978
926
  seekRequest: chrome.cast.media.SeekRequest,
@@ -981,9 +929,9 @@ declare namespace chrome.cast.media {
981
929
  ): void;
982
930
 
983
931
  /**
984
- * @param {chrome.cast.media.StopRequest} stopRequest
985
- * @param {function()} successCallback
986
- * @param {function(!chrome.cast.Error)} errorCallback
932
+ * @param stopRequest
933
+ * @param successCallback
934
+ * @param errorCallback
987
935
  */
988
936
  stop(
989
937
  stopRequest: chrome.cast.media.StopRequest,
@@ -992,9 +940,9 @@ declare namespace chrome.cast.media {
992
940
  ): void;
993
941
 
994
942
  /**
995
- * @param {!chrome.cast.media.VolumeRequest} volumeRequest
996
- * @param {function()} successCallback
997
- * @param {function(!chrome.cast.Error)} errorCallback
943
+ * @param volumeRequest
944
+ * @param successCallback
945
+ * @param errorCallback
998
946
  */
999
947
  setVolume(
1000
948
  volumeRequest: chrome.cast.media.VolumeRequest,
@@ -1003,9 +951,9 @@ declare namespace chrome.cast.media {
1003
951
  ): void;
1004
952
 
1005
953
  /**
1006
- * @param {!chrome.cast.media.EditTracksInfoRequest} editTracksInfoRequest
1007
- * @param {function()} successCallback
1008
- * @param {function(!chrome.cast.Error)} errorCallback
954
+ * @param editTracksInfoRequest
955
+ * @param successCallback
956
+ * @param errorCallback
1009
957
  */
1010
958
  editTracksInfo(
1011
959
  editTracksInfoRequest: chrome.cast.media.EditTracksInfoRequest,
@@ -1014,31 +962,31 @@ declare namespace chrome.cast.media {
1014
962
  ): void;
1015
963
 
1016
964
  /**
1017
- * @param {!chrome.cast.media.MediaCommand} command
1018
- * @return {boolean}
965
+ * @param command
966
+ * @return whether or not the receiver supports the given chrome.cast.media.MediaCommand
1019
967
  */
1020
968
  supportsCommand(command: chrome.cast.media.MediaCommand): boolean;
1021
969
 
1022
970
  /**
1023
- * @param {function(boolean)} listener
971
+ * @param listener
1024
972
  */
1025
973
  addUpdateListener(listener: (isAlive: boolean) => void): void;
1026
974
 
1027
975
  /**
1028
- * @param {function(boolean)} listener
976
+ * @param listener
1029
977
  */
1030
978
  removeUpdateListener(listener: (isAlive: boolean) => void): void;
1031
979
 
1032
980
  /**
1033
- * @return {number}
981
+ * @return
1034
982
  * @suppress {deprecated} Uses currentTime member to compute estimated time.
1035
983
  */
1036
984
  getEstimatedTime(): number;
1037
985
 
1038
986
  /**
1039
- * @param {!chrome.cast.media.QueueItem} item
1040
- * @param {function()} successCallback
1041
- * @param {function(!chrome.cast.Error)} errorCallback
987
+ * @param item
988
+ * @param successCallback
989
+ * @param errorCallback
1042
990
  */
1043
991
  queueAppendItem(
1044
992
  item: chrome.cast.media.QueueItem,
@@ -1047,9 +995,9 @@ declare namespace chrome.cast.media {
1047
995
  ): void;
1048
996
 
1049
997
  /**
1050
- * @param {!chrome.cast.media.QueueInsertItemsRequest} queueInsertItemsRequest
1051
- * @param {function()} successCallback
1052
- * @param {function(!chrome.cast.Error)} errorCallback
998
+ * @param queueInsertItemsRequest
999
+ * @param successCallback
1000
+ * @param errorCallback
1053
1001
  */
1054
1002
  queueInsertItems(
1055
1003
  queueInsertItemsRequest: chrome.cast.media.QueueInsertItemsRequest,
@@ -1058,9 +1006,9 @@ declare namespace chrome.cast.media {
1058
1006
  ): void;
1059
1007
 
1060
1008
  /**
1061
- * @param {!number} itemId
1062
- * @param {function()} successCallback
1063
- * @param {function(!chrome.cast.Error)} errorCallback
1009
+ * @param itemId
1010
+ * @param successCallback
1011
+ * @param errorCallback
1064
1012
  */
1065
1013
  queueJumpToItem(
1066
1014
  itemId: number,
@@ -1069,10 +1017,10 @@ declare namespace chrome.cast.media {
1069
1017
  ): void;
1070
1018
 
1071
1019
  /**
1072
- * @param {!number} itemId
1073
- * @param {!number} newIndex
1074
- * @param {function()} successCallback
1075
- * @param {function(!chrome.cast.Error)} errorCallback
1020
+ * @param itemId
1021
+ * @param newIndex
1022
+ * @param successCallback
1023
+ * @param errorCallback
1076
1024
  */
1077
1025
  queueMoveItemToNewIndex(
1078
1026
  itemId: number,
@@ -1082,21 +1030,21 @@ declare namespace chrome.cast.media {
1082
1030
  ): void;
1083
1031
 
1084
1032
  /**
1085
- * @param {function()} successCallback
1086
- * @param {function(!chrome.cast.Error)} errorCallback
1033
+ * @param successCallback
1034
+ * @param errorCallback
1087
1035
  */
1088
1036
  queueNext(successCallback: Function, errorCallback: (error: chrome.cast.Error) => void): void;
1089
1037
 
1090
1038
  /**
1091
- * @param {function()} successCallback
1092
- * @param {function(!chrome.cast.Error)} errorCallback
1039
+ * @param successCallback
1040
+ * @param errorCallback
1093
1041
  */
1094
1042
  queuePrev(successCallback: Function, errorCallback: (error: chrome.cast.Error) => void): void;
1095
1043
 
1096
1044
  /**
1097
- * @param {!number} itemId
1098
- * @param {function()} successCallback
1099
- * @param {function(!chrome.cast.Error)} errorCallback
1045
+ * @param itemId
1046
+ * @param successCallback
1047
+ * @param errorCallback
1100
1048
  */
1101
1049
  queueRemoveItem(
1102
1050
  itemId: number,
@@ -1105,9 +1053,9 @@ declare namespace chrome.cast.media {
1105
1053
  ): void;
1106
1054
 
1107
1055
  /**
1108
- * @param {!chrome.cast.media.QueueReorderItemsRequest} queueReorderItemsRequest
1109
- * @param {function()} successCallback
1110
- * @param {function(!chrome.cast.Error)} errorCallback
1056
+ * @param queueReorderItemsRequest
1057
+ * @param successCallback
1058
+ * @param errorCallback
1111
1059
  */
1112
1060
  queueReorderItems(
1113
1061
  queueReorderItemsRequest: chrome.cast.media.QueueReorderItemsRequest,
@@ -1116,9 +1064,9 @@ declare namespace chrome.cast.media {
1116
1064
  ): void;
1117
1065
 
1118
1066
  /**
1119
- * @param {!chrome.cast.media.RepeatMode} repeatMode
1120
- * @param {function()} successCallback
1121
- * @param {function(!chrome.cast.Error)} errorCallback
1067
+ * @param repeatMode
1068
+ * @param successCallback
1069
+ * @param errorCallback
1122
1070
  */
1123
1071
  queueSetRepeatMode(
1124
1072
  repeatMode: chrome.cast.media.RepeatMode,
@@ -1127,9 +1075,9 @@ declare namespace chrome.cast.media {
1127
1075
  ): void;
1128
1076
 
1129
1077
  /**
1130
- * @param {!chrome.cast.media.QueueUpdateItemsRequest} queueUpdateItemsRequest
1131
- * @param {function()} successCallback
1132
- * @param {function(!chrome.cast.Error)} errorCallback
1078
+ * @param queueUpdateItemsRequest
1079
+ * @param successCallback
1080
+ * @param errorCallback
1133
1081
  */
1134
1082
  queueUpdateItems(
1135
1083
  queueUpdateItemsRequest: chrome.cast.media.QueueUpdateItemsRequest,
@@ -1140,9 +1088,8 @@ declare namespace chrome.cast.media {
1140
1088
 
1141
1089
  export class Track {
1142
1090
  /**
1143
- * @param {number} trackId
1144
- * @param {!chrome.cast.media.TrackType} trackType
1145
- * @constructor
1091
+ * @param trackId
1092
+ * @param trackType
1146
1093
  * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.Track
1147
1094
  */
1148
1095
  constructor(trackId: number, trackType: chrome.cast.media.TrackType);
@@ -1159,7 +1106,6 @@ declare namespace chrome.cast.media {
1159
1106
 
1160
1107
  export class TextTrackStyle {
1161
1108
  /**
1162
- * @constructor
1163
1109
  * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.TextTrackStyle
1164
1110
  */
1165
1111
  constructor();
@@ -1180,7 +1126,10 @@ declare namespace chrome.cast.media {
1180
1126
 
1181
1127
  export class LiveSeekableRange {
1182
1128
  /**
1183
- * @constructor
1129
+ * @param start
1130
+ * @param end
1131
+ * @param isMovingWindow
1132
+ * @param isLiveDone
1184
1133
  * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.LiveSeekableRange
1185
1134
  */
1186
1135
  constructor(start?: number, end?: number, isMovingWindow?: boolean, isLiveDone?: boolean);
@@ -1193,7 +1142,6 @@ declare namespace chrome.cast.media {
1193
1142
  }
1194
1143
 
1195
1144
  /**
1196
- * @namespace
1197
1145
  * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.timeout
1198
1146
  */
1199
1147
  declare namespace chrome.cast.media.timeout {
chrome/index.d.ts CHANGED
@@ -2,7 +2,6 @@
2
2
  // Project: http://developer.chrome.com/extensions/
3
3
  // Definitions by: Matthew Kimber <https://github.com/matthewkimber>
4
4
  // otiai10 <https://github.com/otiai10>
5
- // couven92 <https://github.com/couven92>
6
5
  // RReverser <https://github.com/rreverser>
7
6
  // sreimer15 <https://github.com/sreimer15>
8
7
  // MatCarlson <https://github.com/MatCarlson>
@@ -22,6 +21,7 @@
22
21
 
23
22
  /// <reference types="filesystem" />
24
23
  /// <reference path="./har-format/index.d.ts" />
24
+ /// <reference path="./chrome-cast/index.d.ts" />
25
25
 
26
26
  ////////////////////
27
27
  // Global object
@@ -1632,10 +1632,9 @@ declare namespace chrome.contextMenus {
1632
1632
  /**
1633
1633
  * Creates a new context menu item. Note that if an error occurs during creation, you may not find out until the creation callback fires (the details will be in chrome.runtime.lastError).
1634
1634
  * @param callback Called when the item has been created in the browser. If there were any problems creating the item, details will be available in chrome.runtime.lastError.
1635
- * If you specify the callback parameter, it should be a function that looks like this:
1636
- * function() {...};
1635
+ * @returns The ID of the newly created item.
1637
1636
  */
1638
- export function create(createProperties: CreateProperties, callback?: () => void): void;
1637
+ export function create(createProperties: CreateProperties, callback?: () => void): number | string;
1639
1638
  /**
1640
1639
  * Updates a previously created context menu item.
1641
1640
  * @param id The ID of the item to update.
@@ -10990,6 +10989,18 @@ declare namespace chrome.declarativeNetRequest {
10990
10989
  /** Ruleset ID for the session-scoped rules added by the extension. */
10991
10990
  export const SESSION_RULESET_ID: string;
10992
10991
 
10992
+ /** This describes the HTTP request method of a network request. */
10993
+ export enum RequestMethod {
10994
+ CONNECT = "connect",
10995
+ DELETE = "delete",
10996
+ GET = "get",
10997
+ HEAD = "head",
10998
+ OPTIONS = "options",
10999
+ PATCH = "patch",
11000
+ POST = "post",
11001
+ PUT = "put"
11002
+ }
11003
+
10993
11004
  /** This describes the resource type of the network request. */
10994
11005
  export enum ResourceType {
10995
11006
  MAIN_FRAME = "main_frame",
@@ -11115,13 +11126,15 @@ declare namespace chrome.declarativeNetRequest {
11115
11126
  type: RuleActionType;
11116
11127
  }
11117
11128
 
11118
- export interface RuleCondition {
11119
- /** Specifies whether the network request is first-party or third-party to the domain from which it originated.
11129
+ export type RuleCondition = {
11130
+ /**
11131
+ * Specifies whether the network request is first-party or third-party to the domain from which it originated.
11120
11132
  * If omitted, all requests are accepted.
11121
11133
  */
11122
11134
  domainType?: DomainType | undefined;
11123
11135
 
11124
- /** The rule will only match network requests originating from the list of domains.
11136
+ /**
11137
+ * The rule will only match network requests originating from the list of domains.
11125
11138
  * If the list is omitted, the rule is applied to requests from all domains.
11126
11139
  * An empty list is not allowed.
11127
11140
  *
@@ -11133,7 +11146,8 @@ declare namespace chrome.declarativeNetRequest {
11133
11146
  */
11134
11147
  domains?: string[] | undefined;
11135
11148
 
11136
- /** The rule will not match network requests originating from the list of excludedDomains.
11149
+ /**
11150
+ * The rule will not match network requests originating from the list of excludedDomains.
11137
11151
  * If the list is empty or omitted, no domains are excluded.
11138
11152
  * This takes precedence over domains.
11139
11153
  *
@@ -11145,19 +11159,36 @@ declare namespace chrome.declarativeNetRequest {
11145
11159
  */
11146
11160
  excludedDomains?: string[] | undefined;
11147
11161
 
11148
- /** List of resource types which the rule won't match.
11149
- * Only one of resourceTypes and excludedResourceTypes should be specified.
11162
+ /**
11163
+ * List of request methods which the rule won't match.
11164
+ * Only one of requestMethods and excludedRequestMethods should be specified.
11165
+ * If neither of them is specified, all request methods are matched.
11166
+ */
11167
+ excludedRequestMethods?: RequestMethod[] | undefined;
11168
+
11169
+ /**
11170
+ * List of resource types which the rule won't match.
11171
+ * Only one of {@link chrome.declarativeNetRequest.RuleCondition.resourceTypes}
11172
+ * and {@link chrome.declarativeNetRequest.RuleCondition.excludedResourceTypes} should be specified.
11150
11173
  * If neither of them is specified, all resource types except "main_frame" are blocked.
11151
11174
  */
11152
11175
  excludedResourceTypes?: ResourceType[] | undefined;
11153
11176
 
11177
+ /**
11178
+ * List of {@link chrome.tabs.Tab.id} which the rule should not match.
11179
+ * An ID of {@link chrome.tabs.TAB_ID_NONE} excludes requests which don't originate from a tab.
11180
+ * Only supported for session-scoped rules.
11181
+ */
11182
+ excludedTabIds?: number[] | undefined;
11183
+
11154
11184
  /**
11155
11185
  * Whether the urlFilter or regexFilter (whichever is specified) is case sensitive.
11156
11186
  * Default is true.
11157
11187
  */
11158
11188
  isUrlFilterCaseSensitive?: boolean | undefined;
11159
11189
 
11160
- /** Regular expression to match against the network request url.
11190
+ /**
11191
+ * Regular expression to match against the network request url.
11161
11192
  * This follows the RE2 syntax.
11162
11193
  *
11163
11194
  * Note: Only one of urlFilter or regexFilter can be specified.
@@ -11167,14 +11198,22 @@ declare namespace chrome.declarativeNetRequest {
11167
11198
  */
11168
11199
  regexFilter?: string | undefined;
11169
11200
 
11170
- /** List of resource types which the rule can match.
11171
- * An empty list is not allowed.
11172
- *
11173
- * Note: this must be specified for allowAllRequests rules and may only include the sub_frame and main_frame resource types.
11201
+ /**
11202
+ * List of HTTP request methods which the rule can match. An empty list is not allowed.
11203
+ * Note: Specifying a {@link chrome.declarativeNetRequest.RuleCondition.requestMethods} rule condition will also exclude non-HTTP(s) requests,
11204
+ * whereas specifying {@link chrome.declarativeNetRequest.RuleCondition.excludedRequestMethods} will not.
11174
11205
  */
11175
- resourceTypes?: ResourceType[] | undefined;
11206
+ requestMethods?: RequestMethod[];
11176
11207
 
11177
- /** The pattern which is matched against the network request url.
11208
+ /**
11209
+ * List of {@link chrome.tabs.Tab.id} which the rule should not match.
11210
+ * An ID of {@link chrome.tabs.TAB_ID_NONE} excludes requests which don't originate from a tab.
11211
+ * An empty list is not allowed. Only supported for session-scoped rules.
11212
+ */
11213
+ tabIds?: number | undefined;
11214
+
11215
+ /**
11216
+ * The pattern which is matched against the network request url.
11178
11217
  * Supported constructs:
11179
11218
  *
11180
11219
  * '*' : Wildcard: Matches any number of characters.
@@ -11199,7 +11238,26 @@ declare namespace chrome.declarativeNetRequest {
11199
11238
  * For example, when the request url is http://abc.рф?q=ф, the urlFilter will be matched against the url http://abc.xn--p1ai/?q=%D1%84.
11200
11239
  */
11201
11240
  urlFilter?: string | undefined;
11202
- }
11241
+ } & (
11242
+ | {
11243
+ /**
11244
+ * List of resource types which the rule won't match.
11245
+ * Only one of {@link chrome.declarativeNetRequest.RuleCondition.resourceTypes}
11246
+ * and {@link chrome.declarativeNetRequest.RuleCondition.excludedResourceTypes} should be specified.
11247
+ * If neither of them is specified, all resource types except "main_frame" are blocked.
11248
+ */
11249
+ excludedResourceTypes?: ResourceType[] | undefined;
11250
+ }
11251
+ | {
11252
+ /**
11253
+ * List of resource types which the rule can match.
11254
+ * An empty list is not allowed.
11255
+ *
11256
+ * Note: this must be specified for allowAllRequests rules and may only include the sub_frame and main_frame resource types.
11257
+ */
11258
+ resourceTypes?: ResourceType[] | undefined;
11259
+ }
11260
+ );
11203
11261
 
11204
11262
  export interface MatchedRule {
11205
11263
  /** A matching rule's ID. */
@@ -11369,7 +11427,8 @@ declare namespace chrome.declarativeNetRequest {
11369
11427
  /** Rules to add. */
11370
11428
  addRules?: Rule[] | undefined;
11371
11429
 
11372
- /** IDs of the rules to remove.
11430
+ /**
11431
+ * IDs of the rules to remove.
11373
11432
  * Any invalid IDs will be ignored.
11374
11433
  */
11375
11434
  removeRuleIds?: number[] | undefined;
chrome/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/chrome",
3
- "version": "0.0.170",
3
+ "version": "0.0.174",
4
4
  "description": "TypeScript definitions for Chrome extension development",
5
5
  "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/chrome",
6
6
  "license": "MIT",
@@ -15,11 +15,6 @@
15
15
  "url": "https://github.com/otiai10",
16
16
  "githubUsername": "otiai10"
17
17
  },
18
- {
19
- "name": "couven92",
20
- "url": "https://github.com/couven92",
21
- "githubUsername": "couven92"
22
- },
23
18
  {
24
19
  "name": "RReverser",
25
20
  "url": "https://github.com/rreverser",
@@ -103,6 +98,6 @@
103
98
  "@types/filesystem": "*",
104
99
  "@types/har-format": "*"
105
100
  },
106
- "typesPublisherContentHash": "7b8a3b7326117b80093beaf50ba7c6f0b7dc907c6c86559c665d9a422daa47ac",
101
+ "typesPublisherContentHash": "e556bbb8979fd7158aac7a70b91a206832698ccce08a8c72a5792d9b417ab06b",
107
102
  "typeScriptVersion": "3.8"
108
103
  }