@types/sharedworker 0.0.82 → 0.0.83

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.82 at https://github.com/microsoft/TypeScript-DOM-lib-generator/releases/tag/%40types%2Fsharedworker%400.0.82.
31
+ You can read what changed in version 0.0.83 at https://github.com/microsoft/TypeScript-DOM-lib-generator/releases/tag/%40types%2Fsharedworker%400.0.83.
package/index.d.ts CHANGED
@@ -818,6 +818,44 @@ declare var CacheStorage: {
818
818
  new(): CacheStorage;
819
819
  };
820
820
 
821
+ interface CanvasCompositing {
822
+ globalAlpha: number;
823
+ globalCompositeOperation: GlobalCompositeOperation;
824
+ }
825
+
826
+ interface CanvasDrawImage {
827
+ drawImage(image: CanvasImageSource, dx: number, dy: number): void;
828
+ drawImage(image: CanvasImageSource, dx: number, dy: number, dw: number, dh: number): void;
829
+ drawImage(image: CanvasImageSource, sx: number, sy: number, sw: number, sh: number, dx: number, dy: number, dw: number, dh: number): void;
830
+ }
831
+
832
+ interface CanvasDrawPath {
833
+ beginPath(): void;
834
+ clip(fillRule?: CanvasFillRule): void;
835
+ clip(path: Path2D, fillRule?: CanvasFillRule): void;
836
+ fill(fillRule?: CanvasFillRule): void;
837
+ fill(path: Path2D, fillRule?: CanvasFillRule): void;
838
+ isPointInPath(x: number, y: number, fillRule?: CanvasFillRule): boolean;
839
+ isPointInPath(path: Path2D, x: number, y: number, fillRule?: CanvasFillRule): boolean;
840
+ isPointInStroke(x: number, y: number): boolean;
841
+ isPointInStroke(path: Path2D, x: number, y: number): boolean;
842
+ stroke(): void;
843
+ stroke(path: Path2D): void;
844
+ }
845
+
846
+ interface CanvasFillStrokeStyles {
847
+ fillStyle: string | CanvasGradient | CanvasPattern;
848
+ strokeStyle: string | CanvasGradient | CanvasPattern;
849
+ createConicGradient(startAngle: number, x: number, y: number): CanvasGradient;
850
+ createLinearGradient(x0: number, y0: number, x1: number, y1: number): CanvasGradient;
851
+ createPattern(image: CanvasImageSource, repetition: string | null): CanvasPattern | null;
852
+ createRadialGradient(x0: number, y0: number, r0: number, x1: number, y1: number, r1: number): CanvasGradient;
853
+ }
854
+
855
+ interface CanvasFilters {
856
+ filter: string;
857
+ }
858
+
821
859
  /** An opaque object describing a gradient. It is returned by the methods CanvasRenderingContext2D.createLinearGradient() or CanvasRenderingContext2D.createRadialGradient(). */
822
860
  interface CanvasGradient {
823
861
  /**
@@ -833,6 +871,19 @@ declare var CanvasGradient: {
833
871
  new(): CanvasGradient;
834
872
  };
835
873
 
874
+ interface CanvasImageData {
875
+ createImageData(sw: number, sh: number, settings?: ImageDataSettings): ImageData;
876
+ createImageData(imagedata: ImageData): ImageData;
877
+ getImageData(sx: number, sy: number, sw: number, sh: number, settings?: ImageDataSettings): ImageData;
878
+ putImageData(imagedata: ImageData, dx: number, dy: number): void;
879
+ putImageData(imagedata: ImageData, dx: number, dy: number, dirtyX: number, dirtyY: number, dirtyWidth: number, dirtyHeight: number): void;
880
+ }
881
+
882
+ interface CanvasImageSmoothing {
883
+ imageSmoothingEnabled: boolean;
884
+ imageSmoothingQuality: ImageSmoothingQuality;
885
+ }
886
+
836
887
  interface CanvasPath {
837
888
  arc(x: number, y: number, radius: number, startAngle: number, endAngle: number, counterclockwise?: boolean): void;
838
889
  arcTo(x1: number, y1: number, x2: number, y2: number, radius: number): void;
@@ -846,6 +897,16 @@ interface CanvasPath {
846
897
  roundRect(x: number, y: number, w: number, h: number, radii?: number | DOMPointInit | (number | DOMPointInit)[]): void;
847
898
  }
848
899
 
900
+ interface CanvasPathDrawingStyles {
901
+ lineCap: CanvasLineCap;
902
+ lineDashOffset: number;
903
+ lineJoin: CanvasLineJoin;
904
+ lineWidth: number;
905
+ miterLimit: number;
906
+ getLineDash(): number[];
907
+ setLineDash(segments: number[]): void;
908
+ }
909
+
849
910
  /** An opaque object describing a pattern, based on an image, a canvas, or a video, created by the CanvasRenderingContext2D.createPattern() method. */
850
911
  interface CanvasPattern {
851
912
  /** Sets the transformation matrix that will be used when rendering the pattern during a fill or stroke painting operation. */
@@ -857,6 +918,49 @@ declare var CanvasPattern: {
857
918
  new(): CanvasPattern;
858
919
  };
859
920
 
921
+ interface CanvasRect {
922
+ clearRect(x: number, y: number, w: number, h: number): void;
923
+ fillRect(x: number, y: number, w: number, h: number): void;
924
+ strokeRect(x: number, y: number, w: number, h: number): void;
925
+ }
926
+
927
+ interface CanvasShadowStyles {
928
+ shadowBlur: number;
929
+ shadowColor: string;
930
+ shadowOffsetX: number;
931
+ shadowOffsetY: number;
932
+ }
933
+
934
+ interface CanvasState {
935
+ restore(): void;
936
+ save(): void;
937
+ }
938
+
939
+ interface CanvasText {
940
+ fillText(text: string, x: number, y: number, maxWidth?: number): void;
941
+ measureText(text: string): TextMetrics;
942
+ strokeText(text: string, x: number, y: number, maxWidth?: number): void;
943
+ }
944
+
945
+ interface CanvasTextDrawingStyles {
946
+ direction: CanvasDirection;
947
+ font: string;
948
+ fontKerning: CanvasFontKerning;
949
+ textAlign: CanvasTextAlign;
950
+ textBaseline: CanvasTextBaseline;
951
+ }
952
+
953
+ interface CanvasTransform {
954
+ getTransform(): DOMMatrix;
955
+ resetTransform(): void;
956
+ rotate(angle: number): void;
957
+ scale(x: number, y: number): void;
958
+ setTransform(a: number, b: number, c: number, d: number, e: number, f: number): void;
959
+ setTransform(transform?: DOMMatrix2DInit): void;
960
+ transform(a: number, b: number, c: number, d: number, e: number, f: number): void;
961
+ translate(x: number, y: number): void;
962
+ }
963
+
860
964
  /** A CloseEvent is sent to clients using WebSockets when the connection is closed. This is delivered to the listener indicated by the WebSocket object's onclose attribute. */
861
965
  interface CloseEvent extends Event {
862
966
  /** Returns the WebSocket connection close code provided by the server. */
@@ -2278,10 +2382,57 @@ interface OVR_multiview2 {
2278
2382
  readonly MAX_VIEWS_OVR: GLenum;
2279
2383
  }
2280
2384
 
2281
- /** @deprecated this is not available in most browsers */
2385
+ interface OffscreenCanvasEventMap {
2386
+ "contextlost": Event;
2387
+ "contextrestored": Event;
2388
+ }
2389
+
2282
2390
  interface OffscreenCanvas extends EventTarget {
2391
+ /**
2392
+ * These attributes return the dimensions of the OffscreenCanvas object's bitmap.
2393
+ *
2394
+ * They can be set, to replace the bitmap with a new, transparent black bitmap of the specified dimensions (effectively resizing it).
2395
+ */
2396
+ height: number;
2397
+ oncontextlost: ((this: OffscreenCanvas, ev: Event) => any) | null;
2398
+ oncontextrestored: ((this: OffscreenCanvas, ev: Event) => any) | null;
2399
+ /**
2400
+ * These attributes return the dimensions of the OffscreenCanvas object's bitmap.
2401
+ *
2402
+ * They can be set, to replace the bitmap with a new, transparent black bitmap of the specified dimensions (effectively resizing it).
2403
+ */
2404
+ width: number;
2405
+ /**
2406
+ * 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.
2407
+ *
2408
+ * 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]
2409
+ *
2410
+ * 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).
2411
+ */
2412
+ getContext(contextId: OffscreenRenderingContextId, options?: any): OffscreenRenderingContext | null;
2413
+ /** 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. */
2414
+ transferToImageBitmap(): ImageBitmap;
2415
+ addEventListener<K extends keyof OffscreenCanvasEventMap>(type: K, listener: (this: OffscreenCanvas, ev: OffscreenCanvasEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
2416
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
2417
+ removeEventListener<K extends keyof OffscreenCanvasEventMap>(type: K, listener: (this: OffscreenCanvas, ev: OffscreenCanvasEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
2418
+ removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
2283
2419
  }
2284
2420
 
2421
+ declare var OffscreenCanvas: {
2422
+ prototype: OffscreenCanvas;
2423
+ new(width: number, height: number): OffscreenCanvas;
2424
+ };
2425
+
2426
+ interface OffscreenCanvasRenderingContext2D extends CanvasCompositing, CanvasDrawImage, CanvasDrawPath, CanvasFillStrokeStyles, CanvasFilters, CanvasImageData, CanvasImageSmoothing, CanvasPath, CanvasPathDrawingStyles, CanvasRect, CanvasShadowStyles, CanvasState, CanvasText, CanvasTextDrawingStyles, CanvasTransform {
2427
+ readonly canvas: OffscreenCanvas;
2428
+ commit(): void;
2429
+ }
2430
+
2431
+ declare var OffscreenCanvasRenderingContext2D: {
2432
+ prototype: OffscreenCanvasRenderingContext2D;
2433
+ new(): OffscreenCanvasRenderingContext2D;
2434
+ };
2435
+
2285
2436
  /** 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. */
2286
2437
  interface Path2D extends CanvasPath {
2287
2438
  /** Adds to the path the path given by the argument. */
@@ -5651,6 +5802,7 @@ type ImageBitmapSource = CanvasImageSource | Blob | ImageData;
5651
5802
  type Int32List = Int32Array | GLint[];
5652
5803
  type MessageEventSource = MessagePort | ServiceWorker;
5653
5804
  type NamedCurve = string;
5805
+ type OffscreenRenderingContext = OffscreenCanvasRenderingContext2D | ImageBitmapRenderingContext | WebGLRenderingContext | WebGL2RenderingContext;
5654
5806
  type OnErrorEventHandler = OnErrorEventHandlerNonNull | null;
5655
5807
  type PerformanceEntryList = PerformanceEntry[];
5656
5808
  type ReadableStreamController<T> = ReadableStreamDefaultController<T> | ReadableByteStreamController;
@@ -5664,6 +5816,16 @@ type Uint32List = Uint32Array | GLuint[];
5664
5816
  type VibratePattern = number | number[];
5665
5817
  type XMLHttpRequestBodyInit = Blob | BufferSource | FormData | URLSearchParams | string;
5666
5818
  type BinaryType = "arraybuffer" | "blob";
5819
+ type CanvasDirection = "inherit" | "ltr" | "rtl";
5820
+ type CanvasFillRule = "evenodd" | "nonzero";
5821
+ type CanvasFontKerning = "auto" | "none" | "normal";
5822
+ type CanvasFontStretch = "condensed" | "expanded" | "extra-condensed" | "extra-expanded" | "normal" | "semi-condensed" | "semi-expanded" | "ultra-condensed" | "ultra-expanded";
5823
+ type CanvasFontVariantCaps = "all-petite-caps" | "all-small-caps" | "normal" | "petite-caps" | "small-caps" | "titling-caps" | "unicase";
5824
+ type CanvasLineCap = "butt" | "round" | "square";
5825
+ type CanvasLineJoin = "bevel" | "miter" | "round";
5826
+ type CanvasTextAlign = "center" | "end" | "left" | "right" | "start";
5827
+ type CanvasTextBaseline = "alphabetic" | "bottom" | "hanging" | "ideographic" | "middle" | "top";
5828
+ type CanvasTextRendering = "auto" | "geometricPrecision" | "optimizeLegibility" | "optimizeSpeed";
5667
5829
  type ClientTypes = "all" | "sharedworker" | "window" | "worker";
5668
5830
  type ColorGamut = "p3" | "rec2020" | "srgb";
5669
5831
  type ColorSpaceConversion = "default" | "none";
@@ -5671,12 +5833,14 @@ type EndingType = "native" | "transparent";
5671
5833
  type FileSystemHandleKind = "directory" | "file";
5672
5834
  type FontFaceLoadStatus = "error" | "loaded" | "loading" | "unloaded";
5673
5835
  type FontFaceSetLoadStatus = "loaded" | "loading";
5836
+ 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";
5674
5837
  type HdrMetadataType = "smpteSt2086" | "smpteSt2094-10" | "smpteSt2094-40";
5675
5838
  type IDBCursorDirection = "next" | "nextunique" | "prev" | "prevunique";
5676
5839
  type IDBRequestReadyState = "done" | "pending";
5677
5840
  type IDBTransactionDurability = "default" | "relaxed" | "strict";
5678
5841
  type IDBTransactionMode = "readonly" | "readwrite" | "versionchange";
5679
5842
  type ImageOrientation = "flipY" | "none";
5843
+ type ImageSmoothingQuality = "high" | "low" | "medium";
5680
5844
  type KeyFormat = "jwk" | "pkcs8" | "raw" | "spki";
5681
5845
  type KeyType = "private" | "public" | "secret";
5682
5846
  type KeyUsage = "decrypt" | "deriveBits" | "deriveKey" | "encrypt" | "sign" | "unwrapKey" | "verify" | "wrapKey";
@@ -5685,6 +5849,7 @@ type MediaDecodingType = "file" | "media-source" | "webrtc";
5685
5849
  type MediaEncodingType = "record" | "webrtc";
5686
5850
  type NotificationDirection = "auto" | "ltr" | "rtl";
5687
5851
  type NotificationPermission = "default" | "denied" | "granted";
5852
+ type OffscreenRenderingContextId = "2d" | "bitmaprenderer" | "webgl" | "webgl2" | "webgpu";
5688
5853
  type PermissionName = "geolocation" | "notifications" | "persistent-storage" | "push" | "screen-wake-lock" | "xr-spatial-tracking";
5689
5854
  type PermissionState = "denied" | "granted" | "prompt";
5690
5855
  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/sharedworker",
3
- "version": "0.0.82",
3
+ "version": "0.0.83",
4
4
  "description": "Types for the global scope of Shared Workers",
5
5
  "license": "Apache-2.0",
6
6
  "contributors": [],