@types/serviceworker 0.0.53 → 0.0.54

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.54 at https://github.com/microsoft/TypeScript-DOM-lib-generator/releases/tag/%40types%2Fserviceworker%400.0.54.
package/index.d.ts CHANGED
@@ -846,6 +846,44 @@ declare var CacheStorage: {
846
846
  new(): CacheStorage;
847
847
  };
848
848
 
849
+ interface CanvasCompositing {
850
+ globalAlpha: number;
851
+ globalCompositeOperation: GlobalCompositeOperation;
852
+ }
853
+
854
+ interface CanvasDrawImage {
855
+ drawImage(image: CanvasImageSource, dx: number, dy: number): void;
856
+ drawImage(image: CanvasImageSource, dx: number, dy: number, dw: number, dh: number): void;
857
+ drawImage(image: CanvasImageSource, sx: number, sy: number, sw: number, sh: number, dx: number, dy: number, dw: number, dh: number): void;
858
+ }
859
+
860
+ interface CanvasDrawPath {
861
+ beginPath(): void;
862
+ clip(fillRule?: CanvasFillRule): void;
863
+ clip(path: Path2D, fillRule?: CanvasFillRule): void;
864
+ fill(fillRule?: CanvasFillRule): void;
865
+ fill(path: Path2D, fillRule?: CanvasFillRule): void;
866
+ isPointInPath(x: number, y: number, fillRule?: CanvasFillRule): boolean;
867
+ isPointInPath(path: Path2D, x: number, y: number, fillRule?: CanvasFillRule): boolean;
868
+ isPointInStroke(x: number, y: number): boolean;
869
+ isPointInStroke(path: Path2D, x: number, y: number): boolean;
870
+ stroke(): void;
871
+ stroke(path: Path2D): void;
872
+ }
873
+
874
+ interface CanvasFillStrokeStyles {
875
+ fillStyle: string | CanvasGradient | CanvasPattern;
876
+ strokeStyle: string | CanvasGradient | CanvasPattern;
877
+ createConicGradient(startAngle: number, x: number, y: number): CanvasGradient;
878
+ createLinearGradient(x0: number, y0: number, x1: number, y1: number): CanvasGradient;
879
+ createPattern(image: CanvasImageSource, repetition: string | null): CanvasPattern | null;
880
+ createRadialGradient(x0: number, y0: number, r0: number, x1: number, y1: number, r1: number): CanvasGradient;
881
+ }
882
+
883
+ interface CanvasFilters {
884
+ filter: string;
885
+ }
886
+
849
887
  /** An opaque object describing a gradient. It is returned by the methods CanvasRenderingContext2D.createLinearGradient() or CanvasRenderingContext2D.createRadialGradient(). */
850
888
  interface CanvasGradient {
851
889
  /**
@@ -861,6 +899,19 @@ declare var CanvasGradient: {
861
899
  new(): CanvasGradient;
862
900
  };
863
901
 
902
+ interface CanvasImageData {
903
+ createImageData(sw: number, sh: number, settings?: ImageDataSettings): ImageData;
904
+ createImageData(imagedata: ImageData): ImageData;
905
+ getImageData(sx: number, sy: number, sw: number, sh: number, settings?: ImageDataSettings): ImageData;
906
+ putImageData(imagedata: ImageData, dx: number, dy: number): void;
907
+ putImageData(imagedata: ImageData, dx: number, dy: number, dirtyX: number, dirtyY: number, dirtyWidth: number, dirtyHeight: number): void;
908
+ }
909
+
910
+ interface CanvasImageSmoothing {
911
+ imageSmoothingEnabled: boolean;
912
+ imageSmoothingQuality: ImageSmoothingQuality;
913
+ }
914
+
864
915
  interface CanvasPath {
865
916
  arc(x: number, y: number, radius: number, startAngle: number, endAngle: number, counterclockwise?: boolean): void;
866
917
  arcTo(x1: number, y1: number, x2: number, y2: number, radius: number): void;
@@ -874,6 +925,16 @@ interface CanvasPath {
874
925
  roundRect(x: number, y: number, w: number, h: number, radii?: number | DOMPointInit | (number | DOMPointInit)[]): void;
875
926
  }
876
927
 
928
+ interface CanvasPathDrawingStyles {
929
+ lineCap: CanvasLineCap;
930
+ lineDashOffset: number;
931
+ lineJoin: CanvasLineJoin;
932
+ lineWidth: number;
933
+ miterLimit: number;
934
+ getLineDash(): number[];
935
+ setLineDash(segments: number[]): void;
936
+ }
937
+
877
938
  /** An opaque object describing a pattern, based on an image, a canvas, or a video, created by the CanvasRenderingContext2D.createPattern() method. */
878
939
  interface CanvasPattern {
879
940
  /** Sets the transformation matrix that will be used when rendering the pattern during a fill or stroke painting operation. */
@@ -885,6 +946,49 @@ declare var CanvasPattern: {
885
946
  new(): CanvasPattern;
886
947
  };
887
948
 
949
+ interface CanvasRect {
950
+ clearRect(x: number, y: number, w: number, h: number): void;
951
+ fillRect(x: number, y: number, w: number, h: number): void;
952
+ strokeRect(x: number, y: number, w: number, h: number): void;
953
+ }
954
+
955
+ interface CanvasShadowStyles {
956
+ shadowBlur: number;
957
+ shadowColor: string;
958
+ shadowOffsetX: number;
959
+ shadowOffsetY: number;
960
+ }
961
+
962
+ interface CanvasState {
963
+ restore(): void;
964
+ save(): void;
965
+ }
966
+
967
+ interface CanvasText {
968
+ fillText(text: string, x: number, y: number, maxWidth?: number): void;
969
+ measureText(text: string): TextMetrics;
970
+ strokeText(text: string, x: number, y: number, maxWidth?: number): void;
971
+ }
972
+
973
+ interface CanvasTextDrawingStyles {
974
+ direction: CanvasDirection;
975
+ font: string;
976
+ fontKerning: CanvasFontKerning;
977
+ textAlign: CanvasTextAlign;
978
+ textBaseline: CanvasTextBaseline;
979
+ }
980
+
981
+ interface CanvasTransform {
982
+ getTransform(): DOMMatrix;
983
+ resetTransform(): void;
984
+ rotate(angle: number): void;
985
+ scale(x: number, y: number): void;
986
+ setTransform(a: number, b: number, c: number, d: number, e: number, f: number): void;
987
+ setTransform(transform?: DOMMatrix2DInit): void;
988
+ transform(a: number, b: number, c: number, d: number, e: number, f: number): void;
989
+ translate(x: number, y: number): void;
990
+ }
991
+
888
992
  /** 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
993
  interface Client {
890
994
  readonly frameType: FrameType;
@@ -2370,10 +2474,57 @@ interface OVR_multiview2 {
2370
2474
  readonly MAX_VIEWS_OVR: GLenum;
2371
2475
  }
2372
2476
 
2373
- /** @deprecated this is not available in most browsers */
2477
+ interface OffscreenCanvasEventMap {
2478
+ "contextlost": Event;
2479
+ "contextrestored": Event;
2480
+ }
2481
+
2374
2482
  interface OffscreenCanvas extends EventTarget {
2483
+ /**
2484
+ * These attributes return the dimensions of the OffscreenCanvas object's bitmap.
2485
+ *
2486
+ * They can be set, to replace the bitmap with a new, transparent black bitmap of the specified dimensions (effectively resizing it).
2487
+ */
2488
+ height: number;
2489
+ oncontextlost: ((this: OffscreenCanvas, ev: Event) => any) | null;
2490
+ oncontextrestored: ((this: OffscreenCanvas, ev: Event) => any) | null;
2491
+ /**
2492
+ * These attributes return the dimensions of the OffscreenCanvas object's bitmap.
2493
+ *
2494
+ * They can be set, to replace the bitmap with a new, transparent black bitmap of the specified dimensions (effectively resizing it).
2495
+ */
2496
+ width: number;
2497
+ /**
2498
+ * 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.
2499
+ *
2500
+ * 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]
2501
+ *
2502
+ * 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).
2503
+ */
2504
+ getContext(contextId: OffscreenRenderingContextId, options?: any): OffscreenRenderingContext | null;
2505
+ /** 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. */
2506
+ transferToImageBitmap(): ImageBitmap;
2507
+ addEventListener<K extends keyof OffscreenCanvasEventMap>(type: K, listener: (this: OffscreenCanvas, ev: OffscreenCanvasEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
2508
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
2509
+ removeEventListener<K extends keyof OffscreenCanvasEventMap>(type: K, listener: (this: OffscreenCanvas, ev: OffscreenCanvasEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
2510
+ removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
2375
2511
  }
2376
2512
 
2513
+ declare var OffscreenCanvas: {
2514
+ prototype: OffscreenCanvas;
2515
+ new(width: number, height: number): OffscreenCanvas;
2516
+ };
2517
+
2518
+ interface OffscreenCanvasRenderingContext2D extends CanvasCompositing, CanvasDrawImage, CanvasDrawPath, CanvasFillStrokeStyles, CanvasFilters, CanvasImageData, CanvasImageSmoothing, CanvasPath, CanvasPathDrawingStyles, CanvasRect, CanvasShadowStyles, CanvasState, CanvasText, CanvasTextDrawingStyles, CanvasTransform {
2519
+ readonly canvas: OffscreenCanvas;
2520
+ commit(): void;
2521
+ }
2522
+
2523
+ declare var OffscreenCanvasRenderingContext2D: {
2524
+ prototype: OffscreenCanvasRenderingContext2D;
2525
+ new(): OffscreenCanvasRenderingContext2D;
2526
+ };
2527
+
2377
2528
  /** 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
2529
  interface Path2D extends CanvasPath {
2379
2530
  /** Adds to the path the path given by the argument. */
@@ -5640,6 +5791,7 @@ type ImageBitmapSource = CanvasImageSource | Blob | ImageData;
5640
5791
  type Int32List = Int32Array | GLint[];
5641
5792
  type MessageEventSource = MessagePort | ServiceWorker;
5642
5793
  type NamedCurve = string;
5794
+ type OffscreenRenderingContext = OffscreenCanvasRenderingContext2D | ImageBitmapRenderingContext | WebGLRenderingContext | WebGL2RenderingContext;
5643
5795
  type OnErrorEventHandler = OnErrorEventHandlerNonNull | null;
5644
5796
  type PerformanceEntryList = PerformanceEntry[];
5645
5797
  type PushMessageDataInit = BufferSource | string;
@@ -5654,6 +5806,16 @@ type Uint32List = Uint32Array | GLuint[];
5654
5806
  type VibratePattern = number | number[];
5655
5807
  type XMLHttpRequestBodyInit = Blob | BufferSource | FormData | URLSearchParams | string;
5656
5808
  type BinaryType = "arraybuffer" | "blob";
5809
+ type CanvasDirection = "inherit" | "ltr" | "rtl";
5810
+ type CanvasFillRule = "evenodd" | "nonzero";
5811
+ type CanvasFontKerning = "auto" | "none" | "normal";
5812
+ type CanvasFontStretch = "condensed" | "expanded" | "extra-condensed" | "extra-expanded" | "normal" | "semi-condensed" | "semi-expanded" | "ultra-condensed" | "ultra-expanded";
5813
+ type CanvasFontVariantCaps = "all-petite-caps" | "all-small-caps" | "normal" | "petite-caps" | "small-caps" | "titling-caps" | "unicase";
5814
+ type CanvasLineCap = "butt" | "round" | "square";
5815
+ type CanvasLineJoin = "bevel" | "miter" | "round";
5816
+ type CanvasTextAlign = "center" | "end" | "left" | "right" | "start";
5817
+ type CanvasTextBaseline = "alphabetic" | "bottom" | "hanging" | "ideographic" | "middle" | "top";
5818
+ type CanvasTextRendering = "auto" | "geometricPrecision" | "optimizeLegibility" | "optimizeSpeed";
5657
5819
  type ClientTypes = "all" | "sharedworker" | "window" | "worker";
5658
5820
  type ColorGamut = "p3" | "rec2020" | "srgb";
5659
5821
  type ColorSpaceConversion = "default" | "none";
@@ -5663,12 +5825,14 @@ type FileSystemHandleKind = "directory" | "file";
5663
5825
  type FontFaceLoadStatus = "error" | "loaded" | "loading" | "unloaded";
5664
5826
  type FontFaceSetLoadStatus = "loaded" | "loading";
5665
5827
  type FrameType = "auxiliary" | "nested" | "none" | "top-level";
5828
+ 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
5829
  type HdrMetadataType = "smpteSt2086" | "smpteSt2094-10" | "smpteSt2094-40";
5667
5830
  type IDBCursorDirection = "next" | "nextunique" | "prev" | "prevunique";
5668
5831
  type IDBRequestReadyState = "done" | "pending";
5669
5832
  type IDBTransactionDurability = "default" | "relaxed" | "strict";
5670
5833
  type IDBTransactionMode = "readonly" | "readwrite" | "versionchange";
5671
5834
  type ImageOrientation = "flipY" | "none";
5835
+ type ImageSmoothingQuality = "high" | "low" | "medium";
5672
5836
  type KeyFormat = "jwk" | "pkcs8" | "raw" | "spki";
5673
5837
  type KeyType = "private" | "public" | "secret";
5674
5838
  type KeyUsage = "decrypt" | "deriveBits" | "deriveKey" | "encrypt" | "sign" | "unwrapKey" | "verify" | "wrapKey";
@@ -5677,6 +5841,7 @@ type MediaDecodingType = "file" | "media-source" | "webrtc";
5677
5841
  type MediaEncodingType = "record" | "webrtc";
5678
5842
  type NotificationDirection = "auto" | "ltr" | "rtl";
5679
5843
  type NotificationPermission = "default" | "denied" | "granted";
5844
+ type OffscreenRenderingContextId = "2d" | "bitmaprenderer" | "webgl" | "webgl2" | "webgpu";
5680
5845
  type PermissionName = "geolocation" | "notifications" | "persistent-storage" | "push" | "screen-wake-lock" | "xr-spatial-tracking";
5681
5846
  type PermissionState = "denied" | "granted" | "prompt";
5682
5847
  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.54",
4
4
  "description": "Types for the global scope of Service Workers",
5
5
  "license": "Apache-2.0",
6
6
  "contributors": [],