@types/sharedworker 0.0.53 → 0.0.57

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 +50 -14
  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.53 at https://github.com/microsoft/TypeScript-DOM-lib-generator/releases/tag/%40types%2Fsharedworker%400.0.53.
31
+ You can read what changed in version 0.0.57 at https://github.com/microsoft/TypeScript-DOM-lib-generator/releases/tag/%40types%2Fsharedworker%400.0.57.
package/index.d.ts CHANGED
@@ -325,7 +325,7 @@ interface NotificationOptions {
325
325
  requireInteraction?: boolean;
326
326
  silent?: boolean;
327
327
  tag?: string;
328
- timestamp?: DOMTimeStamp;
328
+ timestamp?: EpochTimeStamp;
329
329
  vibrate?: VibratePattern;
330
330
  }
331
331
 
@@ -370,7 +370,7 @@ interface PromiseRejectionEventInit extends EventInit {
370
370
 
371
371
  interface PushSubscriptionJSON {
372
372
  endpoint?: string;
373
- expirationTime?: DOMTimeStamp | null;
373
+ expirationTime?: EpochTimeStamp | null;
374
374
  keys?: Record<string, string>;
375
375
  }
376
376
 
@@ -715,7 +715,10 @@ declare var ByteLengthQueuingStrategy: {
715
715
  new(init: QueuingStrategyInit): ByteLengthQueuingStrategy;
716
716
  };
717
717
 
718
- /** Provides a storage mechanism for Request / Response object pairs that are cached, for example as part of the ServiceWorker life cycle. Note that the Cache interface is exposed to windowed scopes as well as workers. You don't have to use it in conjunction with service workers, even though it is defined in the service worker spec. */
718
+ /**
719
+ * Provides a storage mechanism for Request / Response object pairs that are cached, for example as part of the ServiceWorker life cycle. Note that the Cache interface is exposed to windowed scopes as well as workers. You don't have to use it in conjunction with service workers, even though it is defined in the service worker spec.
720
+ * Available only in secure contexts.
721
+ */
719
722
  interface Cache {
720
723
  add(request: RequestInfo): Promise<void>;
721
724
  addAll(requests: RequestInfo[]): Promise<void>;
@@ -731,7 +734,10 @@ declare var Cache: {
731
734
  new(): Cache;
732
735
  };
733
736
 
734
- /** The storage for Cache objects. */
737
+ /**
738
+ * The storage for Cache objects.
739
+ * Available only in secure contexts.
740
+ */
735
741
  interface CacheStorage {
736
742
  delete(cacheName: string): Promise<boolean>;
737
743
  has(cacheName: string): Promise<boolean>;
@@ -811,6 +817,7 @@ declare var CountQueuingStrategy: {
811
817
 
812
818
  /** Basic cryptography features available in the current context. It allows access to a cryptographically strong random number generator and to cryptographic primitives. */
813
819
  interface Crypto {
820
+ /** Available only in secure contexts. */
814
821
  readonly subtle: SubtleCrypto;
815
822
  getRandomValues<T extends ArrayBufferView | null>(array: T): T;
816
823
  }
@@ -820,7 +827,10 @@ declare var Crypto: {
820
827
  new(): Crypto;
821
828
  };
822
829
 
823
- /** The CryptoKey dictionary of the Web Crypto API represents a cryptographic key. */
830
+ /**
831
+ * The CryptoKey dictionary of the Web Crypto API represents a cryptographic key.
832
+ * Available only in secure contexts.
833
+ */
824
834
  interface CryptoKey {
825
835
  readonly algorithm: KeyAlgorithm;
826
836
  readonly extractable: boolean;
@@ -1236,8 +1246,10 @@ interface EventSource extends EventTarget {
1236
1246
  readonly CONNECTING: number;
1237
1247
  readonly OPEN: number;
1238
1248
  addEventListener<K extends keyof EventSourceEventMap>(type: K, listener: (this: EventSource, ev: EventSourceEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
1249
+ addEventListener(type: string, listener: (this: EventSource, event: MessageEvent) => any, options?: boolean | AddEventListenerOptions): void;
1239
1250
  addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
1240
1251
  removeEventListener<K extends keyof EventSourceEventMap>(type: K, listener: (this: EventSource, ev: EventSourceEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
1252
+ removeEventListener(type: string, listener: (this: EventSource, event: MessageEvent) => any, options?: boolean | EventListenerOptions): void;
1241
1253
  removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
1242
1254
  }
1243
1255
 
@@ -2007,6 +2019,7 @@ interface NavigatorOnLine {
2007
2019
  readonly onLine: boolean;
2008
2020
  }
2009
2021
 
2022
+ /** Available only in secure contexts. */
2010
2023
  interface NavigatorStorage {
2011
2024
  readonly storage: StorageManager;
2012
2025
  }
@@ -2290,10 +2303,13 @@ declare var PromiseRejectionEvent: {
2290
2303
  new(type: string, eventInitDict: PromiseRejectionEventInit): PromiseRejectionEvent;
2291
2304
  };
2292
2305
 
2293
- /** This Push API interface provides a way to receive notifications from third-party servers as well as request URLs for push notifications. */
2306
+ /**
2307
+ * This Push API interface provides a way to receive notifications from third-party servers as well as request URLs for push notifications.
2308
+ * Available only in secure contexts.
2309
+ */
2294
2310
  interface PushManager {
2295
2311
  getSubscription(): Promise<PushSubscription | null>;
2296
- permissionState(options?: PushSubscriptionOptionsInit): Promise<PushPermissionState>;
2312
+ permissionState(options?: PushSubscriptionOptionsInit): Promise<PermissionState>;
2297
2313
  subscribe(options?: PushSubscriptionOptionsInit): Promise<PushSubscription>;
2298
2314
  }
2299
2315
 
@@ -2303,7 +2319,10 @@ declare var PushManager: {
2303
2319
  readonly supportedContentEncodings: ReadonlyArray<string>;
2304
2320
  };
2305
2321
 
2306
- /** This Push API interface provides a subcription's URL endpoint and allows unsubscription from a push service. */
2322
+ /**
2323
+ * This Push API interface provides a subcription's URL endpoint and allows unsubscription from a push service.
2324
+ * Available only in secure contexts.
2325
+ */
2307
2326
  interface PushSubscription {
2308
2327
  readonly endpoint: string;
2309
2328
  readonly options: PushSubscriptionOptions;
@@ -2317,6 +2336,7 @@ declare var PushSubscription: {
2317
2336
  new(): PushSubscription;
2318
2337
  };
2319
2338
 
2339
+ /** Available only in secure contexts. */
2320
2340
  interface PushSubscriptionOptions {
2321
2341
  readonly applicationServerKey: ArrayBuffer | null;
2322
2342
  }
@@ -2448,7 +2468,10 @@ interface ServiceWorkerEventMap extends AbstractWorkerEventMap {
2448
2468
  "statechange": Event;
2449
2469
  }
2450
2470
 
2451
- /** This ServiceWorker API interface provides a reference to a service worker. Multiple browsing contexts (e.g. pages, workers, etc.) can be associated with the same service worker, each through a unique ServiceWorker object. */
2471
+ /**
2472
+ * This ServiceWorker API interface provides a reference to a service worker. Multiple browsing contexts (e.g. pages, workers, etc.) can be associated with the same service worker, each through a unique ServiceWorker object.
2473
+ * Available only in secure contexts.
2474
+ */
2452
2475
  interface ServiceWorker extends EventTarget, AbstractWorker {
2453
2476
  onstatechange: ((this: ServiceWorker, ev: Event) => any) | null;
2454
2477
  readonly scriptURL: string;
@@ -2472,7 +2495,10 @@ interface ServiceWorkerContainerEventMap {
2472
2495
  "messageerror": MessageEvent;
2473
2496
  }
2474
2497
 
2475
- /** The ServiceWorkerContainer interface of the ServiceWorker API provides an object representing the service worker as an overall unit in the network ecosystem, including facilities to register, unregister and update service workers, and access the state of service workers and their registrations. */
2498
+ /**
2499
+ * The ServiceWorkerContainer interface of the ServiceWorker API provides an object representing the service worker as an overall unit in the network ecosystem, including facilities to register, unregister and update service workers, and access the state of service workers and their registrations.
2500
+ * Available only in secure contexts.
2501
+ */
2476
2502
  interface ServiceWorkerContainer extends EventTarget {
2477
2503
  readonly controller: ServiceWorker | null;
2478
2504
  oncontrollerchange: ((this: ServiceWorkerContainer, ev: Event) => any) | null;
@@ -2498,7 +2524,10 @@ interface ServiceWorkerRegistrationEventMap {
2498
2524
  "updatefound": Event;
2499
2525
  }
2500
2526
 
2501
- /** This ServiceWorker API interface represents the service worker registration. You register a service worker to control one or more pages that share the same origin. */
2527
+ /**
2528
+ * This ServiceWorker API interface represents the service worker registration. You register a service worker to control one or more pages that share the same origin.
2529
+ * Available only in secure contexts.
2530
+ */
2502
2531
  interface ServiceWorkerRegistration extends EventTarget {
2503
2532
  readonly active: ServiceWorker | null;
2504
2533
  readonly installing: ServiceWorker | null;
@@ -2543,6 +2572,7 @@ declare var SharedWorkerGlobalScope: {
2543
2572
  new(): SharedWorkerGlobalScope;
2544
2573
  };
2545
2574
 
2575
+ /** Available only in secure contexts. */
2546
2576
  interface StorageManager {
2547
2577
  estimate(): Promise<StorageEstimate>;
2548
2578
  persisted(): Promise<boolean>;
@@ -2553,7 +2583,10 @@ declare var StorageManager: {
2553
2583
  new(): StorageManager;
2554
2584
  };
2555
2585
 
2556
- /** This Web Crypto API interface provides a number of low-level cryptographic functions. It is accessed via the Crypto.subtle properties available in a window context (via Window.crypto). */
2586
+ /**
2587
+ * This Web Crypto API interface provides a number of low-level cryptographic functions. It is accessed via the Crypto.subtle properties available in a window context (via Window.crypto).
2588
+ * Available only in secure contexts.
2589
+ */
2557
2590
  interface SubtleCrypto {
2558
2591
  decrypt(algorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams, key: CryptoKey, data: BufferSource): Promise<any>;
2559
2592
  deriveBits(algorithm: AlgorithmIdentifier | EcdhKeyDeriveParams | HkdfParams | Pbkdf2Params, baseKey: CryptoKey, length: number): Promise<ArrayBuffer>;
@@ -4817,6 +4850,7 @@ declare var WebSocket: {
4817
4850
  };
4818
4851
 
4819
4852
  interface WindowOrWorkerGlobalScope {
4853
+ /** Available only in secure contexts. */
4820
4854
  readonly caches: CacheStorage;
4821
4855
  readonly crossOriginIsolated: boolean;
4822
4856
  readonly crypto: Crypto;
@@ -4832,6 +4866,7 @@ interface WindowOrWorkerGlobalScope {
4832
4866
  createImageBitmap(image: ImageBitmapSource, sx: number, sy: number, sw: number, sh: number, options?: ImageBitmapOptions): Promise<ImageBitmap>;
4833
4867
  fetch(input: RequestInfo, init?: RequestInit): Promise<Response>;
4834
4868
  queueMicrotask(callback: VoidFunction): void;
4869
+ reportError(e: any): void;
4835
4870
  setInterval(handler: TimerHandler, timeout?: number, ...arguments: any[]): number;
4836
4871
  setTimeout(handler: TimerHandler, timeout?: number, ...arguments: any[]): number;
4837
4872
  }
@@ -5342,6 +5377,7 @@ declare function importScripts(...urls: (string | URL)[]): void;
5342
5377
  /** 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. */
5343
5378
  declare function dispatchEvent(event: Event): boolean;
5344
5379
  declare var fonts: FontFaceSet;
5380
+ /** Available only in secure contexts. */
5345
5381
  declare var caches: CacheStorage;
5346
5382
  declare var crossOriginIsolated: boolean;
5347
5383
  declare var crypto: Crypto;
@@ -5357,6 +5393,7 @@ declare function createImageBitmap(image: ImageBitmapSource, options?: ImageBitm
5357
5393
  declare function createImageBitmap(image: ImageBitmapSource, sx: number, sy: number, sw: number, sh: number, options?: ImageBitmapOptions): Promise<ImageBitmap>;
5358
5394
  declare function fetch(input: RequestInfo, init?: RequestInit): Promise<Response>;
5359
5395
  declare function queueMicrotask(callback: VoidFunction): void;
5396
+ declare function reportError(e: any): void;
5360
5397
  declare function setInterval(handler: TimerHandler, timeout?: number, ...arguments: any[]): number;
5361
5398
  declare function setTimeout(handler: TimerHandler, timeout?: number, ...arguments: any[]): number;
5362
5399
  declare function addEventListener<K extends keyof SharedWorkerGlobalScopeEventMap>(type: K, listener: (this: SharedWorkerGlobalScope, ev: SharedWorkerGlobalScopeEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
@@ -5371,7 +5408,7 @@ type BodyInit = ReadableStream | XMLHttpRequestBodyInit;
5371
5408
  type BufferSource = ArrayBufferView | ArrayBuffer;
5372
5409
  type CanvasImageSource = ImageBitmap | OffscreenCanvas;
5373
5410
  type DOMHighResTimeStamp = number;
5374
- type DOMTimeStamp = number;
5411
+ type EpochTimeStamp = number;
5375
5412
  type EventListenerOrEventListenerObject = EventListener | EventListenerObject;
5376
5413
  type Float32List = Float32Array | GLfloat[];
5377
5414
  type FormDataEntryValue = File | string;
@@ -5431,7 +5468,6 @@ type PermissionState = "denied" | "granted" | "prompt";
5431
5468
  type PredefinedColorSpace = "display-p3" | "srgb";
5432
5469
  type PremultiplyAlpha = "default" | "none" | "premultiply";
5433
5470
  type PushEncryptionKeyName = "auth" | "p256dh";
5434
- type PushPermissionState = "denied" | "granted" | "prompt";
5435
5471
  type ReferrerPolicy = "" | "no-referrer" | "no-referrer-when-downgrade" | "origin" | "origin-when-cross-origin" | "same-origin" | "strict-origin" | "strict-origin-when-cross-origin" | "unsafe-url";
5436
5472
  type RequestCache = "default" | "force-cache" | "no-cache" | "no-store" | "only-if-cached" | "reload";
5437
5473
  type RequestCredentials = "include" | "omit" | "same-origin";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/sharedworker",
3
- "version": "0.0.53",
3
+ "version": "0.0.57",
4
4
  "description": "Types for the global scope of Shared Workers",
5
5
  "license": "MIT",
6
6
  "contributors": [],