@types/serviceworker 0.0.36 → 0.0.39
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 +1 -1
- package/index.d.ts +42 -14
- package/iterable.d.ts +3 -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.
|
|
31
|
+
You can read what changed in version 0.0.39 at https://github.com/microsoft/TypeScript-DOM-lib-generator/releases/tag/%40types%2Fserviceworker%400.0.39.
|
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
|
}
|
|
@@ -2184,6 +2204,11 @@ interface NavigatorLanguage {
|
|
|
2184
2204
|
readonly languages: ReadonlyArray<string>;
|
|
2185
2205
|
}
|
|
2186
2206
|
|
|
2207
|
+
/** Available only in secure contexts. */
|
|
2208
|
+
interface NavigatorLocks {
|
|
2209
|
+
readonly locks: LockManager;
|
|
2210
|
+
}
|
|
2211
|
+
|
|
2187
2212
|
interface NavigatorNetworkInformation {
|
|
2188
2213
|
readonly connection: NetworkInformation;
|
|
2189
2214
|
}
|
|
@@ -2634,7 +2659,7 @@ interface Request extends Body {
|
|
|
2634
2659
|
|
|
2635
2660
|
declare var Request: {
|
|
2636
2661
|
prototype: Request;
|
|
2637
|
-
new(input: RequestInfo, init?: RequestInit): Request;
|
|
2662
|
+
new(input: RequestInfo | URL, init?: RequestInit): Request;
|
|
2638
2663
|
};
|
|
2639
2664
|
|
|
2640
2665
|
/** This Fetch API interface represents the response to a request. */
|
|
@@ -2779,6 +2804,7 @@ interface ServiceWorkerRegistrationEventMap {
|
|
|
2779
2804
|
interface ServiceWorkerRegistration extends EventTarget {
|
|
2780
2805
|
readonly active: ServiceWorker | null;
|
|
2781
2806
|
readonly installing: ServiceWorker | null;
|
|
2807
|
+
readonly navigationPreload: NavigationPreloadManager;
|
|
2782
2808
|
onupdatefound: ((this: ServiceWorkerRegistration, ev: Event) => any) | null;
|
|
2783
2809
|
readonly pushManager: PushManager;
|
|
2784
2810
|
readonly scope: string;
|
|
@@ -2823,10 +2849,10 @@ interface SubtleCrypto {
|
|
|
2823
2849
|
encrypt(algorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams, key: CryptoKey, data: BufferSource): Promise<any>;
|
|
2824
2850
|
exportKey(format: "jwk", key: CryptoKey): Promise<JsonWebKey>;
|
|
2825
2851
|
exportKey(format: Exclude<KeyFormat, "jwk">, key: CryptoKey): Promise<ArrayBuffer>;
|
|
2826
|
-
generateKey(algorithm: RsaHashedKeyGenParams | EcKeyGenParams, extractable: boolean, keyUsages: KeyUsage
|
|
2827
|
-
generateKey(algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params, extractable: boolean, keyUsages: KeyUsage
|
|
2852
|
+
generateKey(algorithm: RsaHashedKeyGenParams | EcKeyGenParams, extractable: boolean, keyUsages: ReadonlyArray<KeyUsage>): Promise<CryptoKeyPair>;
|
|
2853
|
+
generateKey(algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params, extractable: boolean, keyUsages: ReadonlyArray<KeyUsage>): Promise<CryptoKey>;
|
|
2828
2854
|
generateKey(algorithm: AlgorithmIdentifier, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKeyPair | CryptoKey>;
|
|
2829
|
-
importKey(format: "jwk", keyData: JsonWebKey, algorithm: AlgorithmIdentifier | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | AesKeyAlgorithm, extractable: boolean, keyUsages: KeyUsage
|
|
2855
|
+
importKey(format: "jwk", keyData: JsonWebKey, algorithm: AlgorithmIdentifier | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | AesKeyAlgorithm, extractable: boolean, keyUsages: ReadonlyArray<KeyUsage>): Promise<CryptoKey>;
|
|
2830
2856
|
importKey(format: Exclude<KeyFormat, "jwk">, keyData: BufferSource, algorithm: AlgorithmIdentifier | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | AesKeyAlgorithm, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKey>;
|
|
2831
2857
|
sign(algorithm: AlgorithmIdentifier | RsaPssParams | EcdsaParams, key: CryptoKey, data: BufferSource): Promise<ArrayBuffer>;
|
|
2832
2858
|
unwrapKey(format: KeyFormat, wrappedKey: BufferSource, unwrappingKey: CryptoKey, unwrapAlgorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams, unwrappedKeyAlgorithm: AlgorithmIdentifier | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | AesKeyAlgorithm, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKey>;
|
|
@@ -5110,11 +5136,12 @@ interface WindowOrWorkerGlobalScope {
|
|
|
5110
5136
|
clearTimeout(id?: number): void;
|
|
5111
5137
|
createImageBitmap(image: ImageBitmapSource, options?: ImageBitmapOptions): Promise<ImageBitmap>;
|
|
5112
5138
|
createImageBitmap(image: ImageBitmapSource, sx: number, sy: number, sw: number, sh: number, options?: ImageBitmapOptions): Promise<ImageBitmap>;
|
|
5113
|
-
fetch(input: RequestInfo, init?: RequestInit): Promise<Response>;
|
|
5139
|
+
fetch(input: RequestInfo | URL, init?: RequestInit): Promise<Response>;
|
|
5114
5140
|
queueMicrotask(callback: VoidFunction): void;
|
|
5115
5141
|
reportError(e: any): void;
|
|
5116
5142
|
setInterval(handler: TimerHandler, timeout?: number, ...arguments: any[]): number;
|
|
5117
5143
|
setTimeout(handler: TimerHandler, timeout?: number, ...arguments: any[]): number;
|
|
5144
|
+
structuredClone(value: any, options?: StructuredSerializeOptions): any;
|
|
5118
5145
|
}
|
|
5119
5146
|
|
|
5120
5147
|
interface WorkerGlobalScopeEventMap {
|
|
@@ -5173,7 +5200,7 @@ declare var WorkerLocation: {
|
|
|
5173
5200
|
};
|
|
5174
5201
|
|
|
5175
5202
|
/** 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. */
|
|
5176
|
-
interface WorkerNavigator extends NavigatorConcurrentHardware, NavigatorID, NavigatorLanguage, NavigatorNetworkInformation, NavigatorOnLine, NavigatorStorage {
|
|
5203
|
+
interface WorkerNavigator extends NavigatorConcurrentHardware, NavigatorID, NavigatorLanguage, NavigatorLocks, NavigatorNetworkInformation, NavigatorOnLine, NavigatorStorage {
|
|
5177
5204
|
readonly mediaCapabilities: MediaCapabilities;
|
|
5178
5205
|
}
|
|
5179
5206
|
|
|
@@ -5479,11 +5506,12 @@ declare function clearInterval(id?: number): void;
|
|
|
5479
5506
|
declare function clearTimeout(id?: number): void;
|
|
5480
5507
|
declare function createImageBitmap(image: ImageBitmapSource, options?: ImageBitmapOptions): Promise<ImageBitmap>;
|
|
5481
5508
|
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>;
|
|
5509
|
+
declare function fetch(input: RequestInfo | URL, init?: RequestInit): Promise<Response>;
|
|
5483
5510
|
declare function queueMicrotask(callback: VoidFunction): void;
|
|
5484
5511
|
declare function reportError(e: any): void;
|
|
5485
5512
|
declare function setInterval(handler: TimerHandler, timeout?: number, ...arguments: any[]): number;
|
|
5486
5513
|
declare function setTimeout(handler: TimerHandler, timeout?: number, ...arguments: any[]): number;
|
|
5514
|
+
declare function structuredClone(value: any, options?: StructuredSerializeOptions): any;
|
|
5487
5515
|
declare function addEventListener<K extends keyof ServiceWorkerGlobalScopeEventMap>(type: K, listener: (this: ServiceWorkerGlobalScope, ev: ServiceWorkerGlobalScopeEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
5488
5516
|
declare function addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
5489
5517
|
declare function removeEventListener<K extends keyof ServiceWorkerGlobalScopeEventMap>(type: K, listener: (this: ServiceWorkerGlobalScope, ev: ServiceWorkerGlobalScopeEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
package/iterable.d.ts
CHANGED
|
@@ -58,10 +58,10 @@ interface MessageEvent<T = any> {
|
|
|
58
58
|
|
|
59
59
|
interface SubtleCrypto {
|
|
60
60
|
deriveKey(algorithm: AlgorithmIdentifier | EcdhKeyDeriveParams | HkdfParams | Pbkdf2Params, baseKey: CryptoKey, derivedKeyType: AlgorithmIdentifier | AesDerivedKeyParams | HmacImportParams | HkdfParams | Pbkdf2Params, extractable: boolean, keyUsages: Iterable<KeyUsage>): Promise<CryptoKey>;
|
|
61
|
-
generateKey(algorithm: RsaHashedKeyGenParams | EcKeyGenParams, extractable: boolean, keyUsages: KeyUsage
|
|
62
|
-
generateKey(algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params, extractable: boolean, keyUsages: KeyUsage
|
|
61
|
+
generateKey(algorithm: RsaHashedKeyGenParams | EcKeyGenParams, extractable: boolean, keyUsages: ReadonlyArray<KeyUsage>): Promise<CryptoKeyPair>;
|
|
62
|
+
generateKey(algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params, extractable: boolean, keyUsages: ReadonlyArray<KeyUsage>): Promise<CryptoKey>;
|
|
63
63
|
generateKey(algorithm: AlgorithmIdentifier, extractable: boolean, keyUsages: Iterable<KeyUsage>): Promise<CryptoKeyPair | CryptoKey>;
|
|
64
|
-
importKey(format: "jwk", keyData: JsonWebKey, algorithm: AlgorithmIdentifier | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | AesKeyAlgorithm, extractable: boolean, keyUsages: KeyUsage
|
|
64
|
+
importKey(format: "jwk", keyData: JsonWebKey, algorithm: AlgorithmIdentifier | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | AesKeyAlgorithm, extractable: boolean, keyUsages: ReadonlyArray<KeyUsage>): Promise<CryptoKey>;
|
|
65
65
|
importKey(format: Exclude<KeyFormat, "jwk">, keyData: BufferSource, algorithm: AlgorithmIdentifier | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | AesKeyAlgorithm, extractable: boolean, keyUsages: Iterable<KeyUsage>): Promise<CryptoKey>;
|
|
66
66
|
unwrapKey(format: KeyFormat, wrappedKey: BufferSource, unwrappingKey: CryptoKey, unwrapAlgorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams, unwrappedKeyAlgorithm: AlgorithmIdentifier | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | AesKeyAlgorithm, extractable: boolean, keyUsages: Iterable<KeyUsage>): Promise<CryptoKey>;
|
|
67
67
|
}
|