@types/sharedworker 0.0.82 → 0.0.84

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