@types/serviceworker 0.0.34 → 0.0.37

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.
Files changed (3) hide show
  1. package/README.md +1 -1
  2. package/index.d.ts +35 -11
  3. package/package.json +1 -1
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.34 at https://github.com/microsoft/TypeScript-DOM-lib-generator/releases/tag/%40types%2Fserviceworker%400.0.34.
31
+ You can read what changed in version 0.0.37 at https://github.com/microsoft/TypeScript-DOM-lib-generator/releases/tag/%40types%2Fserviceworker%400.0.37.
package/index.d.ts CHANGED
@@ -361,6 +361,11 @@ interface MultiCacheQueryOptions extends CacheQueryOptions {
361
361
  cacheName?: string;
362
362
  }
363
363
 
364
+ interface NavigationPreloadState {
365
+ enabled?: boolean;
366
+ headerValue?: string;
367
+ }
368
+
364
369
  interface NotificationAction {
365
370
  action: string;
366
371
  icon?: string;
@@ -718,7 +723,7 @@ interface Blob {
718
723
  readonly type: string;
719
724
  arrayBuffer(): Promise<ArrayBuffer>;
720
725
  slice(start?: number, end?: number, contentType?: string): Blob;
721
- stream(): ReadableStream;
726
+ stream(): ReadableStream<Uint8Array>;
722
727
  text(): Promise<string>;
723
728
  }
724
729
 
@@ -778,13 +783,13 @@ declare var ByteLengthQueuingStrategy: {
778
783
  * Available only in secure contexts.
779
784
  */
780
785
  interface Cache {
781
- add(request: RequestInfo): Promise<void>;
786
+ add(request: RequestInfo | URL): Promise<void>;
782
787
  addAll(requests: RequestInfo[]): Promise<void>;
783
- delete(request: RequestInfo, options?: CacheQueryOptions): Promise<boolean>;
784
- keys(request?: RequestInfo, options?: CacheQueryOptions): Promise<ReadonlyArray<Request>>;
785
- match(request: RequestInfo, options?: CacheQueryOptions): Promise<Response | undefined>;
786
- matchAll(request?: RequestInfo, options?: CacheQueryOptions): Promise<ReadonlyArray<Response>>;
787
- put(request: RequestInfo, response: Response): Promise<void>;
788
+ delete(request: RequestInfo | URL, options?: CacheQueryOptions): Promise<boolean>;
789
+ keys(request?: RequestInfo | URL, options?: CacheQueryOptions): Promise<ReadonlyArray<Request>>;
790
+ match(request: RequestInfo | URL, options?: CacheQueryOptions): Promise<Response | undefined>;
791
+ matchAll(request?: RequestInfo | URL, options?: CacheQueryOptions): Promise<ReadonlyArray<Response>>;
792
+ put(request: RequestInfo | URL, response: Response): Promise<void>;
788
793
  }
789
794
 
790
795
  declare var Cache: {
@@ -800,7 +805,7 @@ interface CacheStorage {
800
805
  delete(cacheName: string): Promise<boolean>;
801
806
  has(cacheName: string): Promise<boolean>;
802
807
  keys(): Promise<string[]>;
803
- match(request: RequestInfo, options?: MultiCacheQueryOptions): Promise<Response | undefined>;
808
+ match(request: RequestInfo | URL, options?: MultiCacheQueryOptions): Promise<Response | undefined>;
804
809
  open(cacheName: string): Promise<Cache>;
805
810
  }
806
811
 
@@ -1406,6 +1411,7 @@ declare var ExtendableMessageEvent: {
1406
1411
  interface FetchEvent extends ExtendableEvent {
1407
1412
  readonly clientId: string;
1408
1413
  readonly handled: Promise<undefined>;
1414
+ readonly preloadResponse: Promise<any>;
1409
1415
  readonly request: Request;
1410
1416
  readonly resultingClientId: string;
1411
1417
  respondWith(r: Response | PromiseLike<Response>): void;
@@ -1484,6 +1490,7 @@ declare var FileReader: {
1484
1490
 
1485
1491
  /** Available only in secure contexts. */
1486
1492
  interface FileSystemDirectoryHandle extends FileSystemHandle {
1493
+ readonly kind: "directory";
1487
1494
  getDirectoryHandle(name: string, options?: FileSystemGetDirectoryOptions): Promise<FileSystemDirectoryHandle>;
1488
1495
  getFileHandle(name: string, options?: FileSystemGetFileOptions): Promise<FileSystemFileHandle>;
1489
1496
  removeEntry(name: string, options?: FileSystemRemoveOptions): Promise<void>;
@@ -1497,6 +1504,7 @@ declare var FileSystemDirectoryHandle: {
1497
1504
 
1498
1505
  /** Available only in secure contexts. */
1499
1506
  interface FileSystemFileHandle extends FileSystemHandle {
1507
+ readonly kind: "file";
1500
1508
  getFile(): Promise<File>;
1501
1509
  }
1502
1510
 
@@ -2043,6 +2051,7 @@ declare var ImageBitmapRenderingContext: {
2043
2051
 
2044
2052
  /** The underlying pixel data of an area of a <canvas> element. It is created using the ImageData() constructor or creator methods on the CanvasRenderingContext2D object associated with a canvas: createImageData() and getImageData(). It can also be used to set a part of the canvas by using putImageData(). */
2045
2053
  interface ImageData {
2054
+ readonly colorSpace: PredefinedColorSpace;
2046
2055
  /** Returns the one-dimensional array containing the data in RGBA order, as integers in the range 0 to 255. */
2047
2056
  readonly data: Uint8ClampedArray;
2048
2057
  /** Returns the actual dimensions of the data in the ImageData object, in pixels. */
@@ -2159,6 +2168,19 @@ declare var MessagePort: {
2159
2168
  new(): MessagePort;
2160
2169
  };
2161
2170
 
2171
+ /** Available only in secure contexts. */
2172
+ interface NavigationPreloadManager {
2173
+ disable(): Promise<void>;
2174
+ enable(): Promise<void>;
2175
+ getState(): Promise<NavigationPreloadState>;
2176
+ setHeaderValue(value: string): Promise<void>;
2177
+ }
2178
+
2179
+ declare var NavigationPreloadManager: {
2180
+ prototype: NavigationPreloadManager;
2181
+ new(): NavigationPreloadManager;
2182
+ };
2183
+
2162
2184
  interface NavigatorConcurrentHardware {
2163
2185
  readonly hardwareConcurrency: number;
2164
2186
  }
@@ -2632,7 +2654,7 @@ interface Request extends Body {
2632
2654
 
2633
2655
  declare var Request: {
2634
2656
  prototype: Request;
2635
- new(input: RequestInfo, init?: RequestInit): Request;
2657
+ new(input: RequestInfo | URL, init?: RequestInit): Request;
2636
2658
  };
2637
2659
 
2638
2660
  /** This Fetch API interface represents the response to a request. */
@@ -5108,11 +5130,12 @@ interface WindowOrWorkerGlobalScope {
5108
5130
  clearTimeout(id?: number): void;
5109
5131
  createImageBitmap(image: ImageBitmapSource, options?: ImageBitmapOptions): Promise<ImageBitmap>;
5110
5132
  createImageBitmap(image: ImageBitmapSource, sx: number, sy: number, sw: number, sh: number, options?: ImageBitmapOptions): Promise<ImageBitmap>;
5111
- fetch(input: RequestInfo, init?: RequestInit): Promise<Response>;
5133
+ fetch(input: RequestInfo | URL, init?: RequestInit): Promise<Response>;
5112
5134
  queueMicrotask(callback: VoidFunction): void;
5113
5135
  reportError(e: any): void;
5114
5136
  setInterval(handler: TimerHandler, timeout?: number, ...arguments: any[]): number;
5115
5137
  setTimeout(handler: TimerHandler, timeout?: number, ...arguments: any[]): number;
5138
+ structuredClone(value: any, options?: StructuredSerializeOptions): any;
5116
5139
  }
5117
5140
 
5118
5141
  interface WorkerGlobalScopeEventMap {
@@ -5477,11 +5500,12 @@ declare function clearInterval(id?: number): void;
5477
5500
  declare function clearTimeout(id?: number): void;
5478
5501
  declare function createImageBitmap(image: ImageBitmapSource, options?: ImageBitmapOptions): Promise<ImageBitmap>;
5479
5502
  declare function createImageBitmap(image: ImageBitmapSource, sx: number, sy: number, sw: number, sh: number, options?: ImageBitmapOptions): Promise<ImageBitmap>;
5480
- declare function fetch(input: RequestInfo, init?: RequestInit): Promise<Response>;
5503
+ declare function fetch(input: RequestInfo | URL, init?: RequestInit): Promise<Response>;
5481
5504
  declare function queueMicrotask(callback: VoidFunction): void;
5482
5505
  declare function reportError(e: any): void;
5483
5506
  declare function setInterval(handler: TimerHandler, timeout?: number, ...arguments: any[]): number;
5484
5507
  declare function setTimeout(handler: TimerHandler, timeout?: number, ...arguments: any[]): number;
5508
+ declare function structuredClone(value: any, options?: StructuredSerializeOptions): any;
5485
5509
  declare function addEventListener<K extends keyof ServiceWorkerGlobalScopeEventMap>(type: K, listener: (this: ServiceWorkerGlobalScope, ev: ServiceWorkerGlobalScopeEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
5486
5510
  declare function addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
5487
5511
  declare function removeEventListener<K extends keyof ServiceWorkerGlobalScopeEventMap>(type: K, listener: (this: ServiceWorkerGlobalScope, ev: ServiceWorkerGlobalScopeEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/serviceworker",
3
- "version": "0.0.34",
3
+ "version": "0.0.37",
4
4
  "description": "Types for the global scope of Service Workers",
5
5
  "license": "MIT",
6
6
  "contributors": [],