@types/serviceworker 0.0.41 → 0.0.44

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/README.md CHANGED
@@ -28,4 +28,4 @@ This project does not respect semantic versioning as almost every change could p
28
28
 
29
29
  ## Deploy Metadata
30
30
 
31
- You can read what changed in version 0.0.41 at https://github.com/microsoft/TypeScript-DOM-lib-generator/releases/tag/%40types%2Fserviceworker%400.0.41.
31
+ You can read what changed in version 0.0.44 at https://github.com/microsoft/TypeScript-DOM-lib-generator/releases/tag/%40types%2Fserviceworker%400.0.44.
package/index.d.ts CHANGED
@@ -253,6 +253,10 @@ interface IDBObjectStoreParameters {
253
253
  keyPath?: string | string[] | null;
254
254
  }
255
255
 
256
+ interface IDBTransactionOptions {
257
+ durability?: IDBTransactionDurability;
258
+ }
259
+
256
260
  interface IDBVersionChangeEventInit extends EventInit {
257
261
  newVersion?: number | null;
258
262
  oldVersion?: number;
@@ -462,12 +466,12 @@ interface QueuingStrategyInit {
462
466
  highWaterMark: number;
463
467
  }
464
468
 
465
- interface ReadableStreamDefaultReadDoneResult {
469
+ interface ReadableStreamReadDoneResult {
466
470
  done: true;
467
471
  value?: undefined;
468
472
  }
469
473
 
470
- interface ReadableStreamDefaultReadValueResult<T> {
474
+ interface ReadableStreamReadValueResult<T> {
471
475
  done: false;
472
476
  value: T;
473
477
  }
@@ -952,6 +956,7 @@ declare var CustomEvent: {
952
956
 
953
957
  /** An abnormal event (called an exception) which occurs as a result of calling a method or accessing a property of a web API. */
954
958
  interface DOMException extends Error {
959
+ /** @deprecated */
955
960
  readonly code: number;
956
961
  readonly message: string;
957
962
  readonly name: string;
@@ -1387,7 +1392,7 @@ declare var EventTarget: {
1387
1392
 
1388
1393
  /** Extends the lifetime of the install and activate events dispatched on the global scope as part of the service worker lifecycle. This ensures that any functional events (like FetchEvent) are not dispatched until it upgrades database schemas and deletes the outdated cache entries. */
1389
1394
  interface ExtendableEvent extends Event {
1390
- waitUntil(f: any): void;
1395
+ waitUntil(f: Promise<any>): void;
1391
1396
  }
1392
1397
 
1393
1398
  declare var ExtendableEvent: {
@@ -1708,7 +1713,7 @@ interface IDBDatabase extends EventTarget {
1708
1713
  */
1709
1714
  deleteObjectStore(name: string): void;
1710
1715
  /** Returns a new transaction with the given mode ("readonly" or "readwrite") and scope which can be a single object store name or an array of names. */
1711
- transaction(storeNames: string | string[], mode?: IDBTransactionMode): IDBTransaction;
1716
+ transaction(storeNames: string | string[], mode?: IDBTransactionMode, options?: IDBTransactionOptions): IDBTransaction;
1712
1717
  addEventListener<K extends keyof IDBDatabaseEventMap>(type: K, listener: (this: IDBDatabase, ev: IDBDatabaseEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
1713
1718
  addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
1714
1719
  removeEventListener<K extends keyof IDBDatabaseEventMap>(type: K, listener: (this: IDBDatabase, ev: IDBDatabaseEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
@@ -2194,7 +2199,6 @@ interface NavigatorID {
2194
2199
  readonly appName: string;
2195
2200
  /** @deprecated */
2196
2201
  readonly appVersion: string;
2197
- /** @deprecated */
2198
2202
  readonly platform: string;
2199
2203
  /** @deprecated */
2200
2204
  readonly product: string;
@@ -2211,10 +2215,6 @@ interface NavigatorLocks {
2211
2215
  readonly locks: LockManager;
2212
2216
  }
2213
2217
 
2214
- interface NavigatorNetworkInformation {
2215
- readonly connection: NetworkInformation;
2216
- }
2217
-
2218
2218
  interface NavigatorOnLine {
2219
2219
  readonly onLine: boolean;
2220
2220
  }
@@ -2224,15 +2224,6 @@ interface NavigatorStorage {
2224
2224
  readonly storage: StorageManager;
2225
2225
  }
2226
2226
 
2227
- interface NetworkInformation extends EventTarget {
2228
- readonly type: ConnectionType;
2229
- }
2230
-
2231
- declare var NetworkInformation: {
2232
- prototype: NetworkInformation;
2233
- new(): NetworkInformation;
2234
- };
2235
-
2236
2227
  interface NotificationEventMap {
2237
2228
  "click": Event;
2238
2229
  "close": Event;
@@ -2614,7 +2605,7 @@ declare var ReadableStreamDefaultController: {
2614
2605
  };
2615
2606
 
2616
2607
  interface ReadableStreamDefaultReader<R = any> extends ReadableStreamGenericReader {
2617
- read(): Promise<ReadableStreamDefaultReadResult<R>>;
2608
+ read(): Promise<ReadableStreamReadResult<R>>;
2618
2609
  releaseLock(): void;
2619
2610
  }
2620
2611
 
@@ -2783,6 +2774,7 @@ interface ServiceWorkerGlobalScope extends WorkerGlobalScope {
2783
2774
  onnotificationclose: ((this: ServiceWorkerGlobalScope, ev: NotificationEvent) => any) | null;
2784
2775
  onpush: ((this: ServiceWorkerGlobalScope, ev: PushEvent) => any) | null;
2785
2776
  readonly registration: ServiceWorkerRegistration;
2777
+ readonly serviceWorker: ServiceWorker;
2786
2778
  skipWaiting(): Promise<void>;
2787
2779
  addEventListener<K extends keyof ServiceWorkerGlobalScopeEventMap>(type: K, listener: (this: ServiceWorkerGlobalScope, ev: ServiceWorkerGlobalScopeEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
2788
2780
  addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
@@ -5126,8 +5118,8 @@ interface WindowOrWorkerGlobalScope {
5126
5118
  readonly performance: Performance;
5127
5119
  atob(data: string): string;
5128
5120
  btoa(data: string): string;
5129
- clearInterval(id?: number): void;
5130
- clearTimeout(id?: number): void;
5121
+ clearInterval(id: number | undefined): void;
5122
+ clearTimeout(id: number | undefined): void;
5131
5123
  createImageBitmap(image: ImageBitmapSource, options?: ImageBitmapOptions): Promise<ImageBitmap>;
5132
5124
  createImageBitmap(image: ImageBitmapSource, sx: number, sy: number, sw: number, sh: number, options?: ImageBitmapOptions): Promise<ImageBitmap>;
5133
5125
  fetch(input: RequestInfo | URL, init?: RequestInit): Promise<Response>;
@@ -5194,7 +5186,7 @@ declare var WorkerLocation: {
5194
5186
  };
5195
5187
 
5196
5188
  /** A subset of the Navigator interface allowed to be accessed from a Worker. Such an object is initialized for each worker and is available via the WorkerGlobalScope.navigator property obtained by calling window.self.navigator. */
5197
- interface WorkerNavigator extends NavigatorConcurrentHardware, NavigatorID, NavigatorLanguage, NavigatorLocks, NavigatorNetworkInformation, NavigatorOnLine, NavigatorStorage {
5189
+ interface WorkerNavigator extends NavigatorConcurrentHardware, NavigatorID, NavigatorLanguage, NavigatorLocks, NavigatorOnLine, NavigatorStorage {
5198
5190
  readonly mediaCapabilities: MediaCapabilities;
5199
5191
  }
5200
5192
 
@@ -5218,6 +5210,7 @@ declare var WritableStream: {
5218
5210
 
5219
5211
  /** This Streams API interface represents a controller allowing control of a WritableStream's state. When constructing a WritableStream, the underlying sink is given a corresponding WritableStreamDefaultController instance to manipulate. */
5220
5212
  interface WritableStreamDefaultController {
5213
+ readonly signal: AbortSignal;
5221
5214
  error(e?: any): void;
5222
5215
  }
5223
5216
 
@@ -5466,6 +5459,7 @@ declare var onnotificationclick: ((this: ServiceWorkerGlobalScope, ev: Notificat
5466
5459
  declare var onnotificationclose: ((this: ServiceWorkerGlobalScope, ev: NotificationEvent) => any) | null;
5467
5460
  declare var onpush: ((this: ServiceWorkerGlobalScope, ev: PushEvent) => any) | null;
5468
5461
  declare var registration: ServiceWorkerRegistration;
5462
+ declare var serviceWorker: ServiceWorker;
5469
5463
  declare function skipWaiting(): Promise<void>;
5470
5464
  /** Dispatches a synthetic event event to target and returns true if either event's cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise. */
5471
5465
  declare function dispatchEvent(event: Event): boolean;
@@ -5496,8 +5490,8 @@ declare var origin: string;
5496
5490
  declare var performance: Performance;
5497
5491
  declare function atob(data: string): string;
5498
5492
  declare function btoa(data: string): string;
5499
- declare function clearInterval(id?: number): void;
5500
- declare function clearTimeout(id?: number): void;
5493
+ declare function clearInterval(id: number | undefined): void;
5494
+ declare function clearTimeout(id: number | undefined): void;
5501
5495
  declare function createImageBitmap(image: ImageBitmapSource, options?: ImageBitmapOptions): Promise<ImageBitmap>;
5502
5496
  declare function createImageBitmap(image: ImageBitmapSource, sx: number, sy: number, sw: number, sh: number, options?: ImageBitmapOptions): Promise<ImageBitmap>;
5503
5497
  declare function fetch(input: RequestInfo | URL, init?: RequestInit): Promise<Response>;
@@ -5545,7 +5539,7 @@ type OnErrorEventHandler = OnErrorEventHandlerNonNull | null;
5545
5539
  type PerformanceEntryList = PerformanceEntry[];
5546
5540
  type PushMessageDataInit = BufferSource | string;
5547
5541
  type ReadableStreamController<T> = ReadableStreamDefaultController<T>;
5548
- type ReadableStreamDefaultReadResult<T> = ReadableStreamDefaultReadValueResult<T> | ReadableStreamDefaultReadDoneResult;
5542
+ type ReadableStreamReadResult<T> = ReadableStreamReadValueResult<T> | ReadableStreamReadDoneResult;
5549
5543
  type ReadableStreamReader<T> = ReadableStreamDefaultReader<T>;
5550
5544
  type RequestInfo = Request | string;
5551
5545
  type TexImageSource = ImageBitmap | ImageData | OffscreenCanvas;
@@ -5558,7 +5552,6 @@ type BinaryType = "arraybuffer" | "blob";
5558
5552
  type ClientTypes = "all" | "sharedworker" | "window" | "worker";
5559
5553
  type ColorGamut = "p3" | "rec2020" | "srgb";
5560
5554
  type ColorSpaceConversion = "default" | "none";
5561
- type ConnectionType = "bluetooth" | "cellular" | "ethernet" | "mixed" | "none" | "other" | "unknown" | "wifi";
5562
5555
  type DocumentVisibilityState = "hidden" | "visible";
5563
5556
  type EndingType = "native" | "transparent";
5564
5557
  type FileSystemHandleKind = "directory" | "file";
package/iterable.d.ts CHANGED
@@ -39,7 +39,7 @@ interface Headers {
39
39
 
40
40
  interface IDBDatabase {
41
41
  /** Returns a new transaction with the given mode ("readonly" or "readwrite") and scope which can be a single object store name or an array of names. */
42
- transaction(storeNames: string | Iterable<string>, mode?: IDBTransactionMode): IDBTransaction;
42
+ transaction(storeNames: string | Iterable<string>, mode?: IDBTransactionMode, options?: IDBTransactionOptions): IDBTransaction;
43
43
  }
44
44
 
45
45
  interface IDBObjectStore {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/serviceworker",
3
- "version": "0.0.41",
3
+ "version": "0.0.44",
4
4
  "description": "Types for the global scope of Service Workers",
5
5
  "license": "MIT",
6
6
  "contributors": [],