@types/serviceworker 0.0.53 → 0.0.55

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.53 at https://github.com/microsoft/TypeScript-DOM-lib-generator/releases/tag/%40types%2Fserviceworker%400.0.53.
31
+ You can read what changed in version 0.0.55 at https://github.com/microsoft/TypeScript-DOM-lib-generator/releases/tag/%40types%2Fserviceworker%400.0.55.
package/index.d.ts CHANGED
@@ -205,8 +205,11 @@ interface FileSystemRemoveOptions {
205
205
  }
206
206
 
207
207
  interface FontFaceDescriptors {
208
- display?: string;
208
+ ascentOverride?: string;
209
+ descentOverride?: string;
210
+ display?: FontDisplay;
209
211
  featureSettings?: string;
212
+ lineGapOverride?: string;
210
213
  stretch?: string;
211
214
  style?: string;
212
215
  unicodeRange?: string;
@@ -846,6 +849,44 @@ declare var CacheStorage: {
846
849
  new(): CacheStorage;
847
850
  };
848
851
 
852
+ interface CanvasCompositing {
853
+ globalAlpha: number;
854
+ globalCompositeOperation: GlobalCompositeOperation;
855
+ }
856
+
857
+ interface CanvasDrawImage {
858
+ drawImage(image: CanvasImageSource, dx: number, dy: number): void;
859
+ drawImage(image: CanvasImageSource, dx: number, dy: number, dw: number, dh: number): void;
860
+ drawImage(image: CanvasImageSource, sx: number, sy: number, sw: number, sh: number, dx: number, dy: number, dw: number, dh: number): void;
861
+ }
862
+
863
+ interface CanvasDrawPath {
864
+ beginPath(): void;
865
+ clip(fillRule?: CanvasFillRule): void;
866
+ clip(path: Path2D, fillRule?: CanvasFillRule): void;
867
+ fill(fillRule?: CanvasFillRule): void;
868
+ fill(path: Path2D, fillRule?: CanvasFillRule): void;
869
+ isPointInPath(x: number, y: number, fillRule?: CanvasFillRule): boolean;
870
+ isPointInPath(path: Path2D, x: number, y: number, fillRule?: CanvasFillRule): boolean;
871
+ isPointInStroke(x: number, y: number): boolean;
872
+ isPointInStroke(path: Path2D, x: number, y: number): boolean;
873
+ stroke(): void;
874
+ stroke(path: Path2D): void;
875
+ }
876
+
877
+ interface CanvasFillStrokeStyles {
878
+ fillStyle: string | CanvasGradient | CanvasPattern;
879
+ strokeStyle: string | CanvasGradient | CanvasPattern;
880
+ createConicGradient(startAngle: number, x: number, y: number): CanvasGradient;
881
+ createLinearGradient(x0: number, y0: number, x1: number, y1: number): CanvasGradient;
882
+ createPattern(image: CanvasImageSource, repetition: string | null): CanvasPattern | null;
883
+ createRadialGradient(x0: number, y0: number, r0: number, x1: number, y1: number, r1: number): CanvasGradient;
884
+ }
885
+
886
+ interface CanvasFilters {
887
+ filter: string;
888
+ }
889
+
849
890
  /** An opaque object describing a gradient. It is returned by the methods CanvasRenderingContext2D.createLinearGradient() or CanvasRenderingContext2D.createRadialGradient(). */
850
891
  interface CanvasGradient {
851
892
  /**
@@ -861,6 +902,19 @@ declare var CanvasGradient: {
861
902
  new(): CanvasGradient;
862
903
  };
863
904
 
905
+ interface CanvasImageData {
906
+ createImageData(sw: number, sh: number, settings?: ImageDataSettings): ImageData;
907
+ createImageData(imagedata: ImageData): ImageData;
908
+ getImageData(sx: number, sy: number, sw: number, sh: number, settings?: ImageDataSettings): ImageData;
909
+ putImageData(imagedata: ImageData, dx: number, dy: number): void;
910
+ putImageData(imagedata: ImageData, dx: number, dy: number, dirtyX: number, dirtyY: number, dirtyWidth: number, dirtyHeight: number): void;
911
+ }
912
+
913
+ interface CanvasImageSmoothing {
914
+ imageSmoothingEnabled: boolean;
915
+ imageSmoothingQuality: ImageSmoothingQuality;
916
+ }
917
+
864
918
  interface CanvasPath {
865
919
  arc(x: number, y: number, radius: number, startAngle: number, endAngle: number, counterclockwise?: boolean): void;
866
920
  arcTo(x1: number, y1: number, x2: number, y2: number, radius: number): void;
@@ -874,6 +928,16 @@ interface CanvasPath {
874
928
  roundRect(x: number, y: number, w: number, h: number, radii?: number | DOMPointInit | (number | DOMPointInit)[]): void;
875
929
  }
876
930
 
931
+ interface CanvasPathDrawingStyles {
932
+ lineCap: CanvasLineCap;
933
+ lineDashOffset: number;
934
+ lineJoin: CanvasLineJoin;
935
+ lineWidth: number;
936
+ miterLimit: number;
937
+ getLineDash(): number[];
938
+ setLineDash(segments: number[]): void;
939
+ }
940
+
877
941
  /** An opaque object describing a pattern, based on an image, a canvas, or a video, created by the CanvasRenderingContext2D.createPattern() method. */
878
942
  interface CanvasPattern {
879
943
  /** Sets the transformation matrix that will be used when rendering the pattern during a fill or stroke painting operation. */
@@ -885,6 +949,49 @@ declare var CanvasPattern: {
885
949
  new(): CanvasPattern;
886
950
  };
887
951
 
952
+ interface CanvasRect {
953
+ clearRect(x: number, y: number, w: number, h: number): void;
954
+ fillRect(x: number, y: number, w: number, h: number): void;
955
+ strokeRect(x: number, y: number, w: number, h: number): void;
956
+ }
957
+
958
+ interface CanvasShadowStyles {
959
+ shadowBlur: number;
960
+ shadowColor: string;
961
+ shadowOffsetX: number;
962
+ shadowOffsetY: number;
963
+ }
964
+
965
+ interface CanvasState {
966
+ restore(): void;
967
+ save(): void;
968
+ }
969
+
970
+ interface CanvasText {
971
+ fillText(text: string, x: number, y: number, maxWidth?: number): void;
972
+ measureText(text: string): TextMetrics;
973
+ strokeText(text: string, x: number, y: number, maxWidth?: number): void;
974
+ }
975
+
976
+ interface CanvasTextDrawingStyles {
977
+ direction: CanvasDirection;
978
+ font: string;
979
+ fontKerning: CanvasFontKerning;
980
+ textAlign: CanvasTextAlign;
981
+ textBaseline: CanvasTextBaseline;
982
+ }
983
+
984
+ interface CanvasTransform {
985
+ getTransform(): DOMMatrix;
986
+ resetTransform(): void;
987
+ rotate(angle: number): void;
988
+ scale(x: number, y: number): void;
989
+ setTransform(a: number, b: number, c: number, d: number, e: number, f: number): void;
990
+ setTransform(transform?: DOMMatrix2DInit): void;
991
+ transform(a: number, b: number, c: number, d: number, e: number, f: number): void;
992
+ translate(x: number, y: number): void;
993
+ }
994
+
888
995
  /** The Client interface represents an executable context such as a Worker, or a SharedWorker. Window clients are represented by the more-specific WindowClient. You can get Client/WindowClient objects from methods such as Clients.matchAll() and Clients.get(). */
889
996
  interface Client {
890
997
  readonly frameType: FrameType;
@@ -1581,7 +1688,7 @@ declare var FileSystemHandle: {
1581
1688
  interface FontFace {
1582
1689
  ascentOverride: string;
1583
1690
  descentOverride: string;
1584
- display: string;
1691
+ display: FontDisplay;
1585
1692
  family: string;
1586
1693
  featureSettings: string;
1587
1694
  lineGapOverride: string;
@@ -2370,10 +2477,57 @@ interface OVR_multiview2 {
2370
2477
  readonly MAX_VIEWS_OVR: GLenum;
2371
2478
  }
2372
2479
 
2373
- /** @deprecated this is not available in most browsers */
2480
+ interface OffscreenCanvasEventMap {
2481
+ "contextlost": Event;
2482
+ "contextrestored": Event;
2483
+ }
2484
+
2374
2485
  interface OffscreenCanvas extends EventTarget {
2486
+ /**
2487
+ * These attributes return the dimensions of the OffscreenCanvas object's bitmap.
2488
+ *
2489
+ * They can be set, to replace the bitmap with a new, transparent black bitmap of the specified dimensions (effectively resizing it).
2490
+ */
2491
+ height: number;
2492
+ oncontextlost: ((this: OffscreenCanvas, ev: Event) => any) | null;
2493
+ oncontextrestored: ((this: OffscreenCanvas, ev: Event) => any) | null;
2494
+ /**
2495
+ * These attributes return the dimensions of the OffscreenCanvas object's bitmap.
2496
+ *
2497
+ * They can be set, to replace the bitmap with a new, transparent black bitmap of the specified dimensions (effectively resizing it).
2498
+ */
2499
+ width: number;
2500
+ /**
2501
+ * Returns an object that exposes an API for drawing on the OffscreenCanvas object. contextId specifies the desired API: "2d", "bitmaprenderer", "webgl", or "webgl2". options is handled by that API.
2502
+ *
2503
+ * This specification defines the "2d" context below, which is similar but distinct from the "2d" context that is created from a canvas element. The WebGL specifications define the "webgl" and "webgl2" contexts. [WEBGL]
2504
+ *
2505
+ * Returns null if the canvas has already been initialized with another context type (e.g., trying to get a "2d" context after getting a "webgl" context).
2506
+ */
2507
+ getContext(contextId: OffscreenRenderingContextId, options?: any): OffscreenRenderingContext | null;
2508
+ /** Returns a newly created ImageBitmap object with the image in the OffscreenCanvas object. The image in the OffscreenCanvas object is replaced with a new blank image. */
2509
+ transferToImageBitmap(): ImageBitmap;
2510
+ addEventListener<K extends keyof OffscreenCanvasEventMap>(type: K, listener: (this: OffscreenCanvas, ev: OffscreenCanvasEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
2511
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
2512
+ removeEventListener<K extends keyof OffscreenCanvasEventMap>(type: K, listener: (this: OffscreenCanvas, ev: OffscreenCanvasEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
2513
+ removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
2375
2514
  }
2376
2515
 
2516
+ declare var OffscreenCanvas: {
2517
+ prototype: OffscreenCanvas;
2518
+ new(width: number, height: number): OffscreenCanvas;
2519
+ };
2520
+
2521
+ interface OffscreenCanvasRenderingContext2D extends CanvasCompositing, CanvasDrawImage, CanvasDrawPath, CanvasFillStrokeStyles, CanvasFilters, CanvasImageData, CanvasImageSmoothing, CanvasPath, CanvasPathDrawingStyles, CanvasRect, CanvasShadowStyles, CanvasState, CanvasText, CanvasTextDrawingStyles, CanvasTransform {
2522
+ readonly canvas: OffscreenCanvas;
2523
+ commit(): void;
2524
+ }
2525
+
2526
+ declare var OffscreenCanvasRenderingContext2D: {
2527
+ prototype: OffscreenCanvasRenderingContext2D;
2528
+ new(): OffscreenCanvasRenderingContext2D;
2529
+ };
2530
+
2377
2531
  /** This Canvas 2D API interface is used to declare a path that can then be used on a CanvasRenderingContext2D object. The path methods of the CanvasRenderingContext2D interface are also present on this interface, which gives you the convenience of being able to retain and replay your path whenever desired. */
2378
2532
  interface Path2D extends CanvasPath {
2379
2533
  /** Adds to the path the path given by the argument. */
@@ -5640,6 +5794,7 @@ type ImageBitmapSource = CanvasImageSource | Blob | ImageData;
5640
5794
  type Int32List = Int32Array | GLint[];
5641
5795
  type MessageEventSource = MessagePort | ServiceWorker;
5642
5796
  type NamedCurve = string;
5797
+ type OffscreenRenderingContext = OffscreenCanvasRenderingContext2D | ImageBitmapRenderingContext | WebGLRenderingContext | WebGL2RenderingContext;
5643
5798
  type OnErrorEventHandler = OnErrorEventHandlerNonNull | null;
5644
5799
  type PerformanceEntryList = PerformanceEntry[];
5645
5800
  type PushMessageDataInit = BufferSource | string;
@@ -5654,21 +5809,34 @@ type Uint32List = Uint32Array | GLuint[];
5654
5809
  type VibratePattern = number | number[];
5655
5810
  type XMLHttpRequestBodyInit = Blob | BufferSource | FormData | URLSearchParams | string;
5656
5811
  type BinaryType = "arraybuffer" | "blob";
5812
+ type CanvasDirection = "inherit" | "ltr" | "rtl";
5813
+ type CanvasFillRule = "evenodd" | "nonzero";
5814
+ type CanvasFontKerning = "auto" | "none" | "normal";
5815
+ type CanvasFontStretch = "condensed" | "expanded" | "extra-condensed" | "extra-expanded" | "normal" | "semi-condensed" | "semi-expanded" | "ultra-condensed" | "ultra-expanded";
5816
+ type CanvasFontVariantCaps = "all-petite-caps" | "all-small-caps" | "normal" | "petite-caps" | "small-caps" | "titling-caps" | "unicase";
5817
+ type CanvasLineCap = "butt" | "round" | "square";
5818
+ type CanvasLineJoin = "bevel" | "miter" | "round";
5819
+ type CanvasTextAlign = "center" | "end" | "left" | "right" | "start";
5820
+ type CanvasTextBaseline = "alphabetic" | "bottom" | "hanging" | "ideographic" | "middle" | "top";
5821
+ type CanvasTextRendering = "auto" | "geometricPrecision" | "optimizeLegibility" | "optimizeSpeed";
5657
5822
  type ClientTypes = "all" | "sharedworker" | "window" | "worker";
5658
5823
  type ColorGamut = "p3" | "rec2020" | "srgb";
5659
5824
  type ColorSpaceConversion = "default" | "none";
5660
5825
  type DocumentVisibilityState = "hidden" | "visible";
5661
5826
  type EndingType = "native" | "transparent";
5662
5827
  type FileSystemHandleKind = "directory" | "file";
5828
+ type FontDisplay = "auto" | "block" | "fallback" | "optional" | "swap";
5663
5829
  type FontFaceLoadStatus = "error" | "loaded" | "loading" | "unloaded";
5664
5830
  type FontFaceSetLoadStatus = "loaded" | "loading";
5665
5831
  type FrameType = "auxiliary" | "nested" | "none" | "top-level";
5832
+ type GlobalCompositeOperation = "color" | "color-burn" | "color-dodge" | "copy" | "darken" | "destination-atop" | "destination-in" | "destination-out" | "destination-over" | "difference" | "exclusion" | "hard-light" | "hue" | "lighten" | "lighter" | "luminosity" | "multiply" | "overlay" | "saturation" | "screen" | "soft-light" | "source-atop" | "source-in" | "source-out" | "source-over" | "xor";
5666
5833
  type HdrMetadataType = "smpteSt2086" | "smpteSt2094-10" | "smpteSt2094-40";
5667
5834
  type IDBCursorDirection = "next" | "nextunique" | "prev" | "prevunique";
5668
5835
  type IDBRequestReadyState = "done" | "pending";
5669
5836
  type IDBTransactionDurability = "default" | "relaxed" | "strict";
5670
5837
  type IDBTransactionMode = "readonly" | "readwrite" | "versionchange";
5671
5838
  type ImageOrientation = "flipY" | "none";
5839
+ type ImageSmoothingQuality = "high" | "low" | "medium";
5672
5840
  type KeyFormat = "jwk" | "pkcs8" | "raw" | "spki";
5673
5841
  type KeyType = "private" | "public" | "secret";
5674
5842
  type KeyUsage = "decrypt" | "deriveBits" | "deriveKey" | "encrypt" | "sign" | "unwrapKey" | "verify" | "wrapKey";
@@ -5677,6 +5845,7 @@ type MediaDecodingType = "file" | "media-source" | "webrtc";
5677
5845
  type MediaEncodingType = "record" | "webrtc";
5678
5846
  type NotificationDirection = "auto" | "ltr" | "rtl";
5679
5847
  type NotificationPermission = "default" | "denied" | "granted";
5848
+ type OffscreenRenderingContextId = "2d" | "bitmaprenderer" | "webgl" | "webgl2" | "webgpu";
5680
5849
  type PermissionName = "geolocation" | "notifications" | "persistent-storage" | "push" | "screen-wake-lock" | "xr-spatial-tracking";
5681
5850
  type PermissionState = "denied" | "granted" | "prompt";
5682
5851
  type PredefinedColorSpace = "display-p3" | "srgb";
package/iterable.d.ts CHANGED
@@ -10,6 +10,10 @@ interface CanvasPath {
10
10
  roundRect(x: number, y: number, w: number, h: number, radii?: number | DOMPointInit | Iterable<number | DOMPointInit>): void;
11
11
  }
12
12
 
13
+ interface CanvasPathDrawingStyles {
14
+ setLineDash(segments: Iterable<number>): void;
15
+ }
16
+
13
17
  interface DOMStringList {
14
18
  [Symbol.iterator](): IterableIterator<string>;
15
19
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/serviceworker",
3
- "version": "0.0.53",
3
+ "version": "0.0.55",
4
4
  "description": "Types for the global scope of Service Workers",
5
5
  "license": "Apache-2.0",
6
6
  "contributors": [],