@types/serviceworker 0.0.36 → 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 +32 -10
  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.36 at https://github.com/microsoft/TypeScript-DOM-lib-generator/releases/tag/%40types%2Fserviceworker%400.0.36.
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;
@@ -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;
@@ -2045,6 +2051,7 @@ declare var ImageBitmapRenderingContext: {
2045
2051
 
2046
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(). */
2047
2053
  interface ImageData {
2054
+ readonly colorSpace: PredefinedColorSpace;
2048
2055
  /** Returns the one-dimensional array containing the data in RGBA order, as integers in the range 0 to 255. */
2049
2056
  readonly data: Uint8ClampedArray;
2050
2057
  /** Returns the actual dimensions of the data in the ImageData object, in pixels. */
@@ -2161,6 +2168,19 @@ declare var MessagePort: {
2161
2168
  new(): MessagePort;
2162
2169
  };
2163
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
+
2164
2184
  interface NavigatorConcurrentHardware {
2165
2185
  readonly hardwareConcurrency: number;
2166
2186
  }
@@ -2634,7 +2654,7 @@ interface Request extends Body {
2634
2654
 
2635
2655
  declare var Request: {
2636
2656
  prototype: Request;
2637
- new(input: RequestInfo, init?: RequestInit): Request;
2657
+ new(input: RequestInfo | URL, init?: RequestInit): Request;
2638
2658
  };
2639
2659
 
2640
2660
  /** This Fetch API interface represents the response to a request. */
@@ -5110,11 +5130,12 @@ interface WindowOrWorkerGlobalScope {
5110
5130
  clearTimeout(id?: number): void;
5111
5131
  createImageBitmap(image: ImageBitmapSource, options?: ImageBitmapOptions): Promise<ImageBitmap>;
5112
5132
  createImageBitmap(image: ImageBitmapSource, sx: number, sy: number, sw: number, sh: number, options?: ImageBitmapOptions): Promise<ImageBitmap>;
5113
- fetch(input: RequestInfo, init?: RequestInit): Promise<Response>;
5133
+ fetch(input: RequestInfo | URL, init?: RequestInit): Promise<Response>;
5114
5134
  queueMicrotask(callback: VoidFunction): void;
5115
5135
  reportError(e: any): void;
5116
5136
  setInterval(handler: TimerHandler, timeout?: number, ...arguments: any[]): number;
5117
5137
  setTimeout(handler: TimerHandler, timeout?: number, ...arguments: any[]): number;
5138
+ structuredClone(value: any, options?: StructuredSerializeOptions): any;
5118
5139
  }
5119
5140
 
5120
5141
  interface WorkerGlobalScopeEventMap {
@@ -5479,11 +5500,12 @@ declare function clearInterval(id?: number): void;
5479
5500
  declare function clearTimeout(id?: number): void;
5480
5501
  declare function createImageBitmap(image: ImageBitmapSource, options?: ImageBitmapOptions): Promise<ImageBitmap>;
5481
5502
  declare function createImageBitmap(image: ImageBitmapSource, sx: number, sy: number, sw: number, sh: number, options?: ImageBitmapOptions): Promise<ImageBitmap>;
5482
- declare function fetch(input: RequestInfo, init?: RequestInit): Promise<Response>;
5503
+ declare function fetch(input: RequestInfo | URL, init?: RequestInit): Promise<Response>;
5483
5504
  declare function queueMicrotask(callback: VoidFunction): void;
5484
5505
  declare function reportError(e: any): void;
5485
5506
  declare function setInterval(handler: TimerHandler, timeout?: number, ...arguments: any[]): number;
5486
5507
  declare function setTimeout(handler: TimerHandler, timeout?: number, ...arguments: any[]): number;
5508
+ declare function structuredClone(value: any, options?: StructuredSerializeOptions): any;
5487
5509
  declare function addEventListener<K extends keyof ServiceWorkerGlobalScopeEventMap>(type: K, listener: (this: ServiceWorkerGlobalScope, ev: ServiceWorkerGlobalScopeEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
5488
5510
  declare function addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
5489
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.36",
3
+ "version": "0.0.37",
4
4
  "description": "Types for the global scope of Service Workers",
5
5
  "license": "MIT",
6
6
  "contributors": [],