@nx.js/runtime 0.0.68 → 0.0.69

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 (2) hide show
  1. package/dist/index.d.ts +837 -242
  2. package/package.json +9 -4
package/dist/index.d.ts CHANGED
@@ -3,19 +3,55 @@
3
3
  /// <reference lib="esnext.promise" />
4
4
  /// <reference lib="esnext.iterator" />
5
5
 
6
- declare class AbortSignal extends EventTarget {
7
- readonly reason: any;
8
- readonly aborted: boolean;
9
- onabort: ((this: AbortSignal, ev: Event) => any) | null;
6
+ /**
7
+ * Defines an individual gamepad or other controller, allowing access
8
+ * to information such as button presses, axis positions, and id.
9
+ *
10
+ * @see https://developer.mozilla.org/docs/Web/API/Gamepad
11
+ */
12
+ declare class Gamepad {
13
+ readonly axes: readonly number[];
14
+ readonly buttons: readonly GamepadButton[];
15
+ readonly connected: boolean;
16
+ readonly id: string;
17
+ readonly index: number;
18
+ readonly mapping: GamepadMappingType;
19
+ readonly timestamp: number;
20
+ readonly vibrationActuator: GamepadHapticActuator;
21
+ readonly deviceType: number;
22
+ readonly rawButtons: bigint;
23
+ readonly styleSet: number;
24
+ /**
25
+ * @ignore
26
+ */
10
27
  constructor();
11
- throwIfAborted(): void;
12
- dispatchEvent(event: Event): boolean;
13
- any(signals: Iterable<AbortSignal>): AbortSignal;
14
28
  }
15
- declare class AbortController {
16
- signal: AbortSignal;
29
+ /**
30
+ * Defines an individual button of a gamepad or other controller, allowing access
31
+ * to the current state of different types of buttons available on the control device.
32
+ *
33
+ * @see https://developer.mozilla.org/docs/Web/API/GamepadButton
34
+ */
35
+ declare class GamepadButton {
36
+ pressed: boolean;
37
+ touched: boolean;
38
+ value: number;
39
+ /**
40
+ * @ignore
41
+ */
17
42
  constructor();
18
- abort(reason?: any): void;
43
+ }
44
+ /**
45
+ * Represents hardware in the controller designed to provide haptic feedback
46
+ * to the user (if available), most commonly vibration hardware.
47
+ *
48
+ * @see https://developer.mozilla.org/docs/Web/API/GamepadHapticActuator
49
+ */
50
+ declare class GamepadHapticActuator {
51
+ readonly type: GamepadHapticActuatorType;
52
+ playEffect(type: "dual-rumble", params?: GamepadEffectParameters): Promise<GamepadHapticsResult>;
53
+ reset(): Promise<GamepadHapticsResult>;
54
+ pulse(duration: number, delay?: number): void;
19
55
  }
20
56
  interface EventListener<T extends Event> {
21
57
  (evt: T): void;
@@ -30,7 +66,12 @@ interface EventListenerOptions {
30
66
  interface AddEventListenerOptions extends EventListenerOptions {
31
67
  once?: boolean;
32
68
  passive?: boolean;
33
- signal?: AbortSignal;
69
+ signal?: {
70
+ aborted: boolean;
71
+ addEventListener: (type: string, listener: () => void, options?: {
72
+ once?: boolean;
73
+ }) => void;
74
+ };
34
75
  }
35
76
  /**
36
77
  * EventTarget is a DOM interface implemented by objects that can receive events and may have listeners for them.
@@ -70,55 +111,10 @@ declare class EventTarget {
70
111
  removeEventListener(type: string, callback: EventListenerOrEventListenerObject | null, options?: EventListenerOptions | boolean): void;
71
112
  }
72
113
  /**
73
- * Defines an individual gamepad or other controller, allowing access
74
- * to information such as button presses, axis positions, and id.
75
- *
76
- * @see https://developer.mozilla.org/docs/Web/API/Gamepad
77
- */
78
- declare class Gamepad {
79
- readonly axes: readonly number[];
80
- readonly buttons: readonly GamepadButton[];
81
- readonly connected: boolean;
82
- readonly id: string;
83
- readonly index: number;
84
- readonly mapping: GamepadMappingType;
85
- readonly timestamp: number;
86
- readonly vibrationActuator: GamepadHapticActuator;
87
- readonly deviceType: number;
88
- readonly rawButtons: bigint;
89
- readonly styleSet: number;
90
- /**
91
- * @ignore
92
- */
93
- constructor();
94
- }
95
- /**
96
- * Defines an individual button of a gamepad or other controller, allowing access
97
- * to the current state of different types of buttons available on the control device.
98
- *
99
- * @see https://developer.mozilla.org/docs/Web/API/GamepadButton
100
- */
101
- declare class GamepadButton {
102
- pressed: boolean;
103
- touched: boolean;
104
- value: number;
105
- /**
106
- * @ignore
107
- */
108
- constructor();
109
- }
110
- /**
111
- * Represents hardware in the controller designed to provide haptic feedback
112
- * to the user (if available), most commonly vibration hardware.
113
- *
114
- * @see https://developer.mozilla.org/docs/Web/API/GamepadHapticActuator
114
+ * @internal WeakSet tracking events whose `stopImmediatePropagation()` was called.
115
+ * Used by `EventTarget.dispatchEvent()` to halt listener iteration.
115
116
  */
116
- declare class GamepadHapticActuator {
117
- readonly type: GamepadHapticActuatorType;
118
- playEffect(type: "dual-rumble", params?: GamepadEffectParameters): Promise<GamepadHapticsResult>;
119
- reset(): Promise<GamepadHapticsResult>;
120
- pulse(duration: number, delay?: number): void;
121
- }
117
+ declare const stopImmediatePropagationFlag: WeakSet<Event>;
122
118
  interface EventInit {
123
119
  bubbles?: boolean;
124
120
  cancelable?: boolean;
@@ -147,7 +143,7 @@ declare class Event {
147
143
  readonly timeStamp: number;
148
144
  readonly type: string;
149
145
  constructor(type: string, options?: EventInit);
150
- composedPath(): EventTarget[];
146
+ composedPath(): globalThis.EventTarget[];
151
147
  initEvent(type: string, bubbles?: boolean | undefined, cancelable?: boolean | undefined): void;
152
148
  preventDefault(): void;
153
149
  stopImmediatePropagation(): void;
@@ -199,6 +195,7 @@ interface KeyboardEventInit extends EventModifierInit {
199
195
  repeat?: boolean;
200
196
  }
201
197
  declare class KeyboardEvent extends UIEvent {
198
+ #private;
202
199
  readonly DOM_KEY_LOCATION_STANDARD: 0;
203
200
  readonly DOM_KEY_LOCATION_LEFT: 1;
204
201
  readonly DOM_KEY_LOCATION_RIGHT: 2;
@@ -574,6 +571,7 @@ declare class DOMMatrix extends DOMMatrixReadOnly {
574
571
  * @see https://developer.mozilla.org/docs/Web/API/Path2D
575
572
  */
576
573
  declare class Path2D {
574
+ #private;
577
575
  constructor(path?: Path2D | string);
578
576
  addPath(path: Path2D): void;
579
577
  moveTo(x: number, y: number): void;
@@ -679,6 +677,35 @@ declare class CanvasRenderingContext2D {
679
677
  * @see https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/globalCompositeOperation
680
678
  */
681
679
  globalCompositeOperation: GlobalCompositeOperation;
680
+ /**
681
+ * Specifies the amount of blur applied to shadows. Default is 0 (no blur).
682
+ *
683
+ * @default 0
684
+ * @see https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/shadowBlur
685
+ */
686
+ shadowBlur: number;
687
+ /**
688
+ * Specifies the color of shadows.
689
+ *
690
+ * @default "rgba(0, 0, 0, 0)"
691
+ * @see https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/shadowColor
692
+ */
693
+ get shadowColor(): string;
694
+ set shadowColor(v: string);
695
+ /**
696
+ * Specifies the distance that shadows will be offset horizontally.
697
+ *
698
+ * @default 0
699
+ * @see https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/shadowOffsetX
700
+ */
701
+ shadowOffsetX: number;
702
+ /**
703
+ * Specifies the distance that shadows will be offset vertically.
704
+ *
705
+ * @default 0
706
+ * @see https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/shadowOffsetY
707
+ */
708
+ shadowOffsetY: number;
682
709
  /**
683
710
  * Determines whether scaled images are smoothed (`true`) or not (`false`).
684
711
  *
@@ -1150,7 +1177,7 @@ declare class Screen extends EventTarget {
1150
1177
  * @param quality A number between `0` and `1` indicating the image quality to be used when creating images using file formats that support lossy compression (such as `image/jpeg`). The default quality value will be used if this option is not specified, or if the number is outside the allowed range.
1151
1178
  * @see https://developer.mozilla.org/docs/Web/API/HTMLCanvasElement/toDataURL
1152
1179
  */
1153
- toDataURL(type?: string, quality?: number): void;
1180
+ toDataURL(type?: string, quality?: number): string;
1154
1181
  className: string;
1155
1182
  get nodeType(): number;
1156
1183
  get nodeName(): string;
@@ -1281,6 +1308,35 @@ declare class OffscreenCanvasRenderingContext2D {
1281
1308
  * @see https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/globalCompositeOperation
1282
1309
  */
1283
1310
  globalCompositeOperation: GlobalCompositeOperation;
1311
+ /**
1312
+ * Specifies the amount of blur applied to shadows. Default is 0 (no blur).
1313
+ *
1314
+ * @default 0
1315
+ * @see https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/shadowBlur
1316
+ */
1317
+ shadowBlur: number;
1318
+ /**
1319
+ * Specifies the color of shadows.
1320
+ *
1321
+ * @default "rgba(0, 0, 0, 0)"
1322
+ * @see https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/shadowColor
1323
+ */
1324
+ get shadowColor(): string;
1325
+ set shadowColor(v: string);
1326
+ /**
1327
+ * Specifies the distance that shadows will be offset horizontally.
1328
+ *
1329
+ * @default 0
1330
+ * @see https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/shadowOffsetX
1331
+ */
1332
+ shadowOffsetX: number;
1333
+ /**
1334
+ * Specifies the distance that shadows will be offset vertically.
1335
+ *
1336
+ * @default 0
1337
+ * @see https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/shadowOffsetY
1338
+ */
1339
+ shadowOffsetY: number;
1284
1340
  /**
1285
1341
  * Determines whether scaled images are smoothed (`true`) or not (`false`).
1286
1342
  *
@@ -1890,6 +1946,7 @@ interface BlobPropertyBag {
1890
1946
  * necessarily in a JavaScript-native format.
1891
1947
  */
1892
1948
  declare class Blob {
1949
+ #private;
1893
1950
  /**
1894
1951
  * @param blobParts - An array of BlobPart values that will be concatenated into a single Blob.
1895
1952
  * @param options - An optional object that specifies the `Content-Type` and endings of the Blob.
@@ -2098,12 +2155,16 @@ declare class TextDecoder {
2098
2155
  encoding: string;
2099
2156
  fatal: boolean;
2100
2157
  ignoreBOM: boolean;
2101
- constructor(encoding?: string);
2158
+ constructor(encoding?: string, options?: {
2159
+ fatal?: boolean;
2160
+ ignoreBOM?: boolean;
2161
+ });
2102
2162
  /**
2103
2163
  * Decodes a BufferSource into a string using the specified encoding.
2104
2164
  * If no input is provided, an empty string is returned.
2105
2165
  *
2106
2166
  * **Note:** Currently the `stream` option is not supported.
2167
+ * // TODO: Implement `stream` option to preserve incomplete multi-byte sequences across calls.
2107
2168
  *
2108
2169
  * @param input The BufferSource to decode.
2109
2170
  * @param options The options for decoding.
@@ -2138,6 +2199,35 @@ declare class TextEncoder {
2138
2199
  */
2139
2200
  encodeInto(input: string, destination: Uint8Array): TextEncoderEncodeIntoResult;
2140
2201
  }
2202
+ declare class AbortSignal extends EventTarget {
2203
+ readonly reason: any;
2204
+ readonly aborted: boolean;
2205
+ onabort: ((this: AbortSignal, ev: Event) => any) | null;
2206
+ constructor();
2207
+ throwIfAborted(): void;
2208
+ dispatchEvent(event: Event): boolean;
2209
+ /**
2210
+ * Returns an `AbortSignal` that is already set as aborted.
2211
+ * @see https://developer.mozilla.org/docs/Web/API/AbortSignal/abort_static
2212
+ */
2213
+ static abort(reason?: any): AbortSignal;
2214
+ /**
2215
+ * Returns an `AbortSignal` that automatically aborts after the given number of milliseconds.
2216
+ * @see https://developer.mozilla.org/docs/Web/API/AbortSignal/timeout_static
2217
+ */
2218
+ static timeout(ms: number): AbortSignal;
2219
+ any(signals: Iterable<AbortSignal>): AbortSignal;
2220
+ /**
2221
+ * Returns an `AbortSignal` that aborts when any of the given signals abort.
2222
+ * @see https://developer.mozilla.org/docs/Web/API/AbortSignal/any_static
2223
+ */
2224
+ static any(signals: Iterable<AbortSignal>): AbortSignal;
2225
+ }
2226
+ declare class AbortController {
2227
+ signal: AbortSignal;
2228
+ constructor();
2229
+ abort(reason?: any): void;
2230
+ }
2141
2231
  type ReadableStreamController<T> = ReadableStreamDefaultController<T> | ReadableByteStreamController;
2142
2232
  type ReadableStreamReadResult<T> = ReadableStreamReadValueResult<T> | ReadableStreamReadDoneResult<T>;
2143
2233
  type ReadableStreamReader<T> = ReadableStreamDefaultReader<T> | ReadableStreamBYOBReader;
@@ -2449,6 +2539,7 @@ interface StreamPipeOptions {
2449
2539
  }
2450
2540
  type FormDataEntryValue = string | File;
2451
2541
  declare class FormData {
2542
+ #private;
2452
2543
  constructor();
2453
2544
  append(name: string, value: string | Blob): void;
2454
2545
  append(name: string, value: string): void;
@@ -2489,6 +2580,7 @@ type HeadersInit = [
2489
2580
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers)
2490
2581
  */
2491
2582
  declare class Headers {
2583
+ #private;
2492
2584
  constructor(init?: HeadersInit);
2493
2585
  /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Headers/append) */
2494
2586
  append(name: string, value: string): void;
@@ -2522,9 +2614,11 @@ declare class Headers {
2522
2614
  }
2523
2615
  type BodyInit = ReadableStream<any> | Blob | BufferSource | FormData | URLSearchParams | string;
2524
2616
  declare abstract class Body {
2617
+ #private;
2525
2618
  body: ReadableStream<Uint8Array> | null;
2526
- bodyUsed: boolean;
2527
2619
  headers: Headers;
2620
+ get bodyUsed(): boolean;
2621
+ set bodyUsed(value: boolean);
2528
2622
  constructor(init?: Body | BodyInit | null, headers?: HeadersInit);
2529
2623
  /**
2530
2624
  * Returns a promise that resolves with an ArrayBuffer representation of the body.
@@ -2636,7 +2730,7 @@ declare class Response extends Body {
2636
2730
  get ok(): boolean;
2637
2731
  /**
2638
2732
  * Clone the response.
2639
- * @throws {Error} - This method is not implemented.
2733
+ * @returns {Response} - A copy of the response with a tee'd body stream.
2640
2734
  */
2641
2735
  clone(): Response;
2642
2736
  /**
@@ -2835,6 +2929,7 @@ interface ConsoleOptions {
2835
2929
  printErr?(s: string): void;
2836
2930
  }
2837
2931
  declare class Console {
2932
+ #private;
2838
2933
  constructor(opts?: ConsoleOptions);
2839
2934
  /**
2840
2935
  * Prints string `s` to the console on the screen, without any formatting applied.
@@ -2875,6 +2970,90 @@ declare class Console {
2875
2970
  * including a stack trace of where the function was invoked.
2876
2971
  */
2877
2972
  trace: (...input: unknown[]) => void;
2973
+ /**
2974
+ * Logs the formatted `input` if `condition` is falsy.
2975
+ *
2976
+ * @see https://developer.mozilla.org/docs/Web/API/console/assert_static
2977
+ */
2978
+ assert: (condition?: boolean, ...args: unknown[]) => void;
2979
+ /**
2980
+ * Logs the number of times `count()` has been called with the given label.
2981
+ *
2982
+ * @see https://developer.mozilla.org/docs/Web/API/console/count_static
2983
+ */
2984
+ count: (label?: string) => void;
2985
+ /**
2986
+ * Resets the counter for the given label.
2987
+ *
2988
+ * @see https://developer.mozilla.org/docs/Web/API/console/countReset_static
2989
+ */
2990
+ countReset: (label?: string) => void;
2991
+ /**
2992
+ * Displays an interactive listing of the properties of the specified object.
2993
+ *
2994
+ * @see https://developer.mozilla.org/docs/Web/API/console/dir_static
2995
+ */
2996
+ dir: (item?: unknown) => void;
2997
+ /**
2998
+ * Alias for {@link Console.dir}.
2999
+ *
3000
+ * @see https://developer.mozilla.org/docs/Web/API/console/dirxml_static
3001
+ */
3002
+ dirxml: (item?: unknown) => void;
3003
+ /**
3004
+ * Creates a new inline group, indenting subsequent console messages.
3005
+ *
3006
+ * @see https://developer.mozilla.org/docs/Web/API/console/group_static
3007
+ */
3008
+ group: (...label: unknown[]) => void;
3009
+ /**
3010
+ * Alias for {@link Console.group}.
3011
+ *
3012
+ * @see https://developer.mozilla.org/docs/Web/API/console/groupCollapsed_static
3013
+ */
3014
+ groupCollapsed: (...label: unknown[]) => void;
3015
+ /**
3016
+ * Exits the current inline group.
3017
+ *
3018
+ * @see https://developer.mozilla.org/docs/Web/API/console/groupEnd_static
3019
+ */
3020
+ groupEnd: () => void;
3021
+ /**
3022
+ * Displays tabular data as a table. Falls back to {@link Console.log}.
3023
+ *
3024
+ * @see https://developer.mozilla.org/docs/Web/API/console/table_static
3025
+ */
3026
+ table: (data?: unknown) => void;
3027
+ /**
3028
+ * Starts a timer with the given label.
3029
+ *
3030
+ * @see https://developer.mozilla.org/docs/Web/API/console/time_static
3031
+ */
3032
+ time: (label?: string) => void;
3033
+ /**
3034
+ * Logs the elapsed time for the given timer and removes it.
3035
+ *
3036
+ * @see https://developer.mozilla.org/docs/Web/API/console/timeEnd_static
3037
+ */
3038
+ timeEnd: (label?: string) => void;
3039
+ /**
3040
+ * Logs the elapsed time for the given timer without removing it.
3041
+ *
3042
+ * @see https://developer.mozilla.org/docs/Web/API/console/timeLog_static
3043
+ */
3044
+ timeLog: (label?: string, ...args: unknown[]) => void;
3045
+ /**
3046
+ * Clears the console by printing the ANSI escape code for clearing the terminal.
3047
+ *
3048
+ * @see https://developer.mozilla.org/docs/Web/API/console/clear_static
3049
+ */
3050
+ clear: () => void;
3051
+ /**
3052
+ * Outputs a message at the "info" log level. Alias for {@link Console.log}.
3053
+ *
3054
+ * @see https://developer.mozilla.org/docs/Web/API/console/info_static
3055
+ */
3056
+ info: (...input: unknown[]) => void;
2878
3057
  }
2879
3058
  /**
2880
3059
  * The global `console` object contains functions for printing text to the
@@ -2892,33 +3071,76 @@ declare class Console {
2892
3071
  * @see https://developer.mozilla.org/docs/Web/API/console
2893
3072
  */
2894
3073
  declare var console: Console;
3074
+ interface Uint8ArrayToBase64Options {
3075
+ alphabet?: "base64" | "base64url";
3076
+ omitPadding?: boolean;
3077
+ }
3078
+ interface Uint8ArrayFromBase64Options {
3079
+ alphabet?: "base64" | "base64url";
3080
+ lastChunkHandling?: "loose" | "strict" | "stop-before-partial";
3081
+ }
3082
+ interface Uint8ArraySetFromResult {
3083
+ read: number;
3084
+ written: number;
3085
+ }
2895
3086
  /**
2896
- * Provides information about the system's battery charge level.
2897
- * The {@link Navigator.getBattery | `navigator.getBattery()`} method
2898
- * returns a promise that resolves to a `BatteryManager` instance.
2899
- *
2900
- * @see https://developer.mozilla.org/docs/Web/API/BatteryManager
3087
+ * Type declarations for the native DOMException class provided by QuickJS-ng.
3088
+ * The runtime implementation lives in the engine itself — this file only
3089
+ * exists so the types are emitted in the published `index.d.ts`.
2901
3090
  */
2902
- declare class BatteryManager extends EventTarget {
2903
- /**
2904
- * @ignore
2905
- */
2906
- constructor();
2907
- /**
2908
- * A number representing the system's battery charge level scaled
2909
- * to a value between 0.0 and 1.0.
2910
- *
2911
- * @see https://developer.mozilla.org/docs/Web/API/BatteryManager/level
2912
- */
2913
- readonly level: number;
2914
- /**
2915
- * A Boolean value indicating whether the battery is currently being charged.
2916
- *
2917
- * @see https://developer.mozilla.org/docs/Web/API/BatteryManager/charging
2918
- */
2919
- readonly charging: boolean;
2920
- get chargingTime(): number;
2921
- get dischargingTime(): number;
3091
+ declare class DOMException extends Error {
3092
+ constructor(message?: string, name?: string);
3093
+ readonly code: number;
3094
+ static readonly INDEX_SIZE_ERR: 1;
3095
+ static readonly DOMSTRING_SIZE_ERR: 2;
3096
+ static readonly HIERARCHY_REQUEST_ERR: 3;
3097
+ static readonly WRONG_DOCUMENT_ERR: 4;
3098
+ static readonly INVALID_CHARACTER_ERR: 5;
3099
+ static readonly NO_DATA_ALLOWED_ERR: 6;
3100
+ static readonly NO_MODIFICATION_ALLOWED_ERR: 7;
3101
+ static readonly NOT_FOUND_ERR: 8;
3102
+ static readonly NOT_SUPPORTED_ERR: 9;
3103
+ static readonly INUSE_ATTRIBUTE_ERR: 10;
3104
+ static readonly INVALID_STATE_ERR: 11;
3105
+ static readonly SYNTAX_ERR: 12;
3106
+ static readonly INVALID_MODIFICATION_ERR: 13;
3107
+ static readonly NAMESPACE_ERR: 14;
3108
+ static readonly INVALID_ACCESS_ERR: 15;
3109
+ static readonly VALIDATION_ERR: 16;
3110
+ static readonly TYPE_MISMATCH_ERR: 17;
3111
+ static readonly SECURITY_ERR: 18;
3112
+ static readonly NETWORK_ERR: 19;
3113
+ static readonly ABORT_ERR: 20;
3114
+ static readonly URL_MISMATCH_ERR: 21;
3115
+ static readonly QUOTA_EXCEEDED_ERR: 22;
3116
+ static readonly TIMEOUT_ERR: 23;
3117
+ static readonly INVALID_NODE_TYPE_ERR: 24;
3118
+ static readonly DATA_CLONE_ERR: 25;
3119
+ readonly INDEX_SIZE_ERR: 1;
3120
+ readonly DOMSTRING_SIZE_ERR: 2;
3121
+ readonly HIERARCHY_REQUEST_ERR: 3;
3122
+ readonly WRONG_DOCUMENT_ERR: 4;
3123
+ readonly INVALID_CHARACTER_ERR: 5;
3124
+ readonly NO_DATA_ALLOWED_ERR: 6;
3125
+ readonly NO_MODIFICATION_ALLOWED_ERR: 7;
3126
+ readonly NOT_FOUND_ERR: 8;
3127
+ readonly NOT_SUPPORTED_ERR: 9;
3128
+ readonly INUSE_ATTRIBUTE_ERR: 10;
3129
+ readonly INVALID_STATE_ERR: 11;
3130
+ readonly SYNTAX_ERR: 12;
3131
+ readonly INVALID_MODIFICATION_ERR: 13;
3132
+ readonly NAMESPACE_ERR: 14;
3133
+ readonly INVALID_ACCESS_ERR: 15;
3134
+ readonly VALIDATION_ERR: 16;
3135
+ readonly TYPE_MISMATCH_ERR: 17;
3136
+ readonly SECURITY_ERR: 18;
3137
+ readonly NETWORK_ERR: 19;
3138
+ readonly ABORT_ERR: 20;
3139
+ readonly URL_MISMATCH_ERR: 21;
3140
+ readonly QUOTA_EXCEEDED_ERR: 22;
3141
+ readonly TIMEOUT_ERR: 23;
3142
+ readonly INVALID_NODE_TYPE_ERR: 24;
3143
+ readonly DATA_CLONE_ERR: 25;
2922
3144
  }
2923
3145
  interface DOMRectInit {
2924
3146
  height?: number;
@@ -2968,25 +3190,122 @@ declare class DOMRect extends DOMRectReadOnly {
2968
3190
  static fromRect(o?: DOMRectInit): DOMRect;
2969
3191
  }
2970
3192
  /**
2971
- * @see https://developer.mozilla.org/docs/Web/API/VirtualKeyboard
3193
+ * Defines the source of a font face, either a URL to an external resource or a
3194
+ * buffer, and font properties such as `style`, `weight`, and so on. For URL
3195
+ * font sources it allows authors to trigger when the remote font is fetched
3196
+ * and loaded, and to track loading status.
3197
+ *
3198
+ * @see https://developer.mozilla.org/docs/Web/API/FontFace
2972
3199
  */
2973
- declare class VirtualKeyboard extends EventTarget {
2974
- /**
2975
- * Indicates the position and size of the on-screen virtual keyboard that overlays the screen.
2976
- *
2977
- * @see https://developer.mozilla.org/docs/Web/API/VirtualKeyboard/boundingRect
2978
- */
2979
- readonly boundingRect: DOMRect;
2980
- /**
2981
- * Set the type of virtual keyboard.
2982
- */
2983
- type?: number;
2984
- /**
2985
- * Text to display for the "OK" button. Max of 8 characters.
2986
- *
2987
- * @example "Submit"
2988
- */
2989
- okButtonText?: string;
3200
+ declare class FontFace {
3201
+ ascentOverride: string;
3202
+ descentOverride: string;
3203
+ display: FontDisplay;
3204
+ family: string;
3205
+ featureSettings: string;
3206
+ lineGapOverride: string;
3207
+ readonly loaded: Promise<this>;
3208
+ readonly status: FontFaceLoadStatus;
3209
+ stretch: string;
3210
+ style: string;
3211
+ unicodeRange: string;
3212
+ weight: string;
3213
+ constructor(family: string, source: string | BufferSource, descriptors?: FontFaceDescriptors);
3214
+ load(): Promise<this>;
3215
+ }
3216
+ /**
3217
+ * Manages the loading of font-faces and querying of their download status.
3218
+ *
3219
+ * @see https://developer.mozilla.org/docs/Web/API/FontFaceSet
3220
+ */
3221
+ declare class FontFaceSet extends EventTarget {
3222
+ #private;
3223
+ /**
3224
+ * @ignore
3225
+ */
3226
+ constructor();
3227
+ onloading: ((this: FontFaceSet, ev: Event) => any) | null;
3228
+ onloadingdone: ((this: FontFaceSet, ev: Event) => any) | null;
3229
+ onloadingerror: ((this: FontFaceSet, ev: Event) => any) | null;
3230
+ ready: Promise<this>;
3231
+ status: FontFaceSetLoadStatus;
3232
+ check(font: string, text?: string | undefined): boolean;
3233
+ load(font: string, text?: string | undefined): Promise<FontFace[]>;
3234
+ get size(): number;
3235
+ add(font: FontFace): this;
3236
+ clear(): void;
3237
+ delete(font: FontFace): boolean;
3238
+ has(font: FontFace): boolean;
3239
+ keys(): IterableIterator<FontFace>;
3240
+ values(): IterableIterator<FontFace>;
3241
+ entries(): IterableIterator<[
3242
+ FontFace,
3243
+ FontFace
3244
+ ]>;
3245
+ forEach(callbackfn: (value: FontFace, key: FontFace, parent: FontFaceSet) => void, thisArg?: any): void;
3246
+ [Symbol.iterator](): IterableIterator<FontFace>;
3247
+ }
3248
+ /**
3249
+ * Contains the available fonts for use on the {@link screen | `screen`} Canvas context.
3250
+ *
3251
+ * There are two built-in fonts available:
3252
+ *
3253
+ * - `"system-ui"` is the system font provided by the Switch operating system.
3254
+ * - `"system-icons"` contains the icons used by the Switch operating system.
3255
+ *
3256
+ * Custom fonts can be added to the set using the {@link FontFaceSet.add | `add()`} method.
3257
+ *
3258
+ * @see https://nxjs.n8.io/runtime/concepts/fonts
3259
+ */
3260
+ declare var fonts: FontFaceSet;
3261
+ /**
3262
+ * Provides information about the system's battery charge level.
3263
+ * The {@link Navigator.getBattery | `navigator.getBattery()`} method
3264
+ * returns a promise that resolves to a `BatteryManager` instance.
3265
+ *
3266
+ * @see https://developer.mozilla.org/docs/Web/API/BatteryManager
3267
+ */
3268
+ declare class BatteryManager extends EventTarget {
3269
+ /**
3270
+ * @ignore
3271
+ */
3272
+ constructor();
3273
+ /**
3274
+ * A number representing the system's battery charge level scaled
3275
+ * to a value between 0.0 and 1.0.
3276
+ *
3277
+ * @see https://developer.mozilla.org/docs/Web/API/BatteryManager/level
3278
+ */
3279
+ readonly level: number;
3280
+ /**
3281
+ * A Boolean value indicating whether the battery is currently being charged.
3282
+ *
3283
+ * @see https://developer.mozilla.org/docs/Web/API/BatteryManager/charging
3284
+ */
3285
+ readonly charging: boolean;
3286
+ get chargingTime(): number;
3287
+ get dischargingTime(): number;
3288
+ }
3289
+ /**
3290
+ * @see https://developer.mozilla.org/docs/Web/API/VirtualKeyboard
3291
+ */
3292
+ declare class VirtualKeyboard extends EventTarget {
3293
+ /**
3294
+ * Indicates the position and size of the on-screen virtual keyboard that overlays the screen.
3295
+ *
3296
+ * @see https://developer.mozilla.org/docs/Web/API/VirtualKeyboard/boundingRect
3297
+ */
3298
+ readonly boundingRect: DOMRect;
3299
+ /**
3300
+ * Set the type of virtual keyboard.
3301
+ */
3302
+ type?: number;
3303
+ /**
3304
+ * Text to display for the "OK" button. Max of 8 characters.
3305
+ *
3306
+ * @example "Submit"
3307
+ */
3308
+ okButtonText?: string;
2990
3309
  /**
2991
3310
  * Single character to use for the left-side button.
2992
3311
  *
@@ -3204,74 +3523,26 @@ declare class Navigator {
3204
3523
  get virtualKeyboard(): VirtualKeyboard;
3205
3524
  }
3206
3525
  declare var navigator: Navigator;
3207
- /**
3208
- * Defines the source of a font face, either a URL to an external resource or a
3209
- * buffer, and font properties such as `style`, `weight`, and so on. For URL
3210
- * font sources it allows authors to trigger when the remote font is fetched
3211
- * and loaded, and to track loading status.
3212
- *
3213
- * @see https://developer.mozilla.org/docs/Web/API/FontFace
3214
- */
3215
- declare class FontFace {
3216
- ascentOverride: string;
3217
- descentOverride: string;
3218
- display: FontDisplay;
3219
- family: string;
3220
- featureSettings: string;
3221
- lineGapOverride: string;
3222
- readonly loaded: Promise<this>;
3223
- readonly status: FontFaceLoadStatus;
3224
- stretch: string;
3225
- style: string;
3226
- unicodeRange: string;
3227
- weight: string;
3228
- constructor(family: string, source: string | BufferSource, descriptors?: FontFaceDescriptors);
3229
- load(): Promise<this>;
3526
+ interface FrameRequestCallback {
3527
+ (time: DOMHighResTimeStamp): void;
3230
3528
  }
3231
3529
  /**
3232
- * Manages the loading of font-faces and querying of their download status.
3530
+ * Cancels an animation frame request previously scheduled through
3531
+ * a call to {@link requestAnimationFrame | `requestAnimationFrame()`}.
3233
3532
  *
3234
- * @see https://developer.mozilla.org/docs/Web/API/FontFaceSet
3533
+ * @param id The ID value returned by the call to {@link requestAnimationFrame | `requestAnimationFrame()`} that requested the callback.
3534
+ * @see https://developer.mozilla.org/docs/Web/API/window/cancelAnimationFrame
3235
3535
  */
3236
- declare class FontFaceSet extends EventTarget {
3237
- /**
3238
- * @ignore
3239
- */
3240
- constructor();
3241
- onloading: ((this: FontFaceSet, ev: Event) => any) | null;
3242
- onloadingdone: ((this: FontFaceSet, ev: Event) => any) | null;
3243
- onloadingerror: ((this: FontFaceSet, ev: Event) => any) | null;
3244
- ready: Promise<this>;
3245
- status: FontFaceSetLoadStatus;
3246
- check(font: string, text?: string | undefined): boolean;
3247
- load(font: string, text?: string | undefined): Promise<FontFace[]>;
3248
- get size(): number;
3249
- add(font: FontFace): this;
3250
- clear(): void;
3251
- delete(font: FontFace): boolean;
3252
- has(font: FontFace): boolean;
3253
- keys(): IterableIterator<FontFace>;
3254
- values(): IterableIterator<FontFace>;
3255
- entries(): IterableIterator<[
3256
- FontFace,
3257
- FontFace
3258
- ]>;
3259
- forEach(callbackfn: (value: FontFace, key: FontFace, parent: FontFaceSet) => void, thisArg?: any): void;
3260
- [Symbol.iterator](): IterableIterator<FontFace>;
3261
- }
3536
+ declare function cancelAnimationFrame(id: number): void;
3262
3537
  /**
3263
- * Contains the available fonts for use on the {@link screen | `screen`} Canvas context.
3264
- *
3265
- * There are two built-in fonts available:
3266
- *
3267
- * - `"system-ui"` is the system font provided by the Switch operating system.
3268
- * - `"system-icons"` contains the icons used by the Switch operating system.
3269
- *
3270
- * Custom fonts can be added to the set using the {@link FontFaceSet.add | `add()`} method.
3538
+ * Tells the application that you wish to perform an animation. The application
3539
+ * will call the supplied callback function prior to the next repaint.
3271
3540
  *
3272
- * @see https://nxjs.n8.io/runtime/concepts/fonts
3541
+ * @param callback The function to call when it's time to update your animation for the next repaint.
3542
+ * @returns The request ID, that uniquely identifies the entry in the callback list. You can pass this value to {@link cancelAnimationFrame | `cancelAnimationFrame()`} to cancel the refresh callback request.
3543
+ * @see https://developer.mozilla.org/docs/Web/API/window/requestAnimationFrame
3273
3544
  */
3274
- declare var fonts: FontFaceSet;
3545
+ declare function requestAnimationFrame(callback: FrameRequestCallback): number;
3275
3546
  /**
3276
3547
  * Represents a handler for a timer. Can be a string or a function.
3277
3548
  */
@@ -3310,26 +3581,6 @@ declare function clearTimeout(id?: number): void;
3310
3581
  * @param id - The ID of the timer you want to clear, as returned by {@link setInterval | `setInterval()`}.
3311
3582
  */
3312
3583
  declare function clearInterval(id?: number): void;
3313
- interface FrameRequestCallback {
3314
- (time: DOMHighResTimeStamp): void;
3315
- }
3316
- /**
3317
- * Cancels an animation frame request previously scheduled through
3318
- * a call to {@link requestAnimationFrame | `requestAnimationFrame()`}.
3319
- *
3320
- * @param id The ID value returned by the call to {@link requestAnimationFrame | `requestAnimationFrame()`} that requested the callback.
3321
- * @see https://developer.mozilla.org/docs/Web/API/window/cancelAnimationFrame
3322
- */
3323
- declare function cancelAnimationFrame(id: number): void;
3324
- /**
3325
- * Tells the application that you wish to perform an animation. The application
3326
- * will call the supplied callback function prior to the next repaint.
3327
- *
3328
- * @param callback The function to call when it's time to update your animation for the next repaint.
3329
- * @returns The request ID, that uniquely identifies the entry in the callback list. You can pass this value to {@link cancelAnimationFrame | `cancelAnimationFrame()`} to cancel the refresh callback request.
3330
- * @see https://developer.mozilla.org/docs/Web/API/window/requestAnimationFrame
3331
- */
3332
- declare function requestAnimationFrame(callback: FrameRequestCallback): number;
3333
3584
  /**
3334
3585
  * @see https://developer.mozilla.org/docs/Web/API/Storage
3335
3586
  */
@@ -3542,6 +3793,57 @@ declare function atob(s: string): string;
3542
3793
  */
3543
3794
  declare function btoa(s: string): string;
3544
3795
  /**
3796
+ * @see https://developer.mozilla.org/docs/Web/API/PerformanceEntry
3797
+ */
3798
+ declare class PerformanceEntry {
3799
+ readonly name: string;
3800
+ readonly entryType: string;
3801
+ readonly startTime: DOMHighResTimeStamp;
3802
+ readonly duration: DOMHighResTimeStamp;
3803
+ /** @ignore */
3804
+ constructor();
3805
+ toJSON(): {
3806
+ name: string;
3807
+ entryType: string;
3808
+ startTime: number;
3809
+ duration: number;
3810
+ };
3811
+ }
3812
+ /**
3813
+ * @see https://developer.mozilla.org/docs/Web/API/PerformanceMark
3814
+ */
3815
+ declare class PerformanceMark extends PerformanceEntry {
3816
+ readonly detail: unknown;
3817
+ /** @ignore */
3818
+ constructor();
3819
+ toJSON(): {
3820
+ detail: unknown;
3821
+ name: string;
3822
+ entryType: string;
3823
+ startTime: number;
3824
+ duration: number;
3825
+ };
3826
+ }
3827
+ /**
3828
+ * @see https://developer.mozilla.org/docs/Web/API/PerformanceMeasure
3829
+ */
3830
+ declare class PerformanceMeasure extends PerformanceEntry {
3831
+ readonly detail: unknown;
3832
+ /** @ignore */
3833
+ constructor();
3834
+ toJSON(): {
3835
+ detail: unknown;
3836
+ name: string;
3837
+ entryType: string;
3838
+ startTime: number;
3839
+ duration: number;
3840
+ };
3841
+ }
3842
+ /**
3843
+ * Note: `performance.now()` currently uses `Date.now()` internally, providing
3844
+ * millisecond resolution. A future version may use the Switch's `svcGetSystemTick`
3845
+ * for sub-millisecond precision once a native binding is available.
3846
+ *
3545
3847
  * @see https://developer.mozilla.org/docs/Web/API/Performance_API
3546
3848
  */
3547
3849
  declare class Performance {
@@ -3549,14 +3851,66 @@ declare class Performance {
3549
3851
  * @see https://developer.mozilla.org/docs/Web/API/Performance/timeOrigin
3550
3852
  */
3551
3853
  readonly timeOrigin: DOMHighResTimeStamp;
3854
+ /** @internal */
3855
+ private _entries;
3552
3856
  /**
3553
3857
  * @ignore
3554
3858
  */
3555
3859
  constructor();
3556
3860
  /**
3861
+ * Returns the number of milliseconds elapsed since `timeOrigin`.
3862
+ *
3557
3863
  * @see https://developer.mozilla.org/docs/Web/API/Performance/now
3558
3864
  */
3559
3865
  now(): DOMHighResTimeStamp;
3866
+ /**
3867
+ * Creates a named `PerformanceMark` in the performance timeline.
3868
+ *
3869
+ * @see https://developer.mozilla.org/docs/Web/API/Performance/mark
3870
+ */
3871
+ mark(markName: string, markOptions?: {
3872
+ startTime?: DOMHighResTimeStamp;
3873
+ detail?: unknown;
3874
+ }): PerformanceMark;
3875
+ /**
3876
+ * Creates a named `PerformanceMeasure` between two marks or timestamps.
3877
+ *
3878
+ * @see https://developer.mozilla.org/docs/Web/API/Performance/measure
3879
+ */
3880
+ measure(measureName: string, startOrMeasureOptions?: string | {
3881
+ start?: string | DOMHighResTimeStamp;
3882
+ end?: string | DOMHighResTimeStamp;
3883
+ duration?: DOMHighResTimeStamp;
3884
+ detail?: unknown;
3885
+ }, endMark?: string): PerformanceMeasure;
3886
+ /**
3887
+ * @see https://developer.mozilla.org/docs/Web/API/Performance/getEntries
3888
+ */
3889
+ getEntries(): PerformanceEntry[];
3890
+ /**
3891
+ * @see https://developer.mozilla.org/docs/Web/API/Performance/getEntriesByName
3892
+ */
3893
+ getEntriesByName(name: string, type?: string): PerformanceEntry[];
3894
+ /**
3895
+ * @see https://developer.mozilla.org/docs/Web/API/Performance/getEntriesByType
3896
+ */
3897
+ getEntriesByType(type: string): PerformanceEntry[];
3898
+ /**
3899
+ * @see https://developer.mozilla.org/docs/Web/API/Performance/clearMarks
3900
+ */
3901
+ clearMarks(markName?: string): void;
3902
+ /**
3903
+ * @see https://developer.mozilla.org/docs/Web/API/Performance/clearMeasures
3904
+ */
3905
+ clearMeasures(measureName?: string): void;
3906
+ /**
3907
+ * @see https://developer.mozilla.org/docs/Web/API/Performance/toJSON
3908
+ */
3909
+ toJSON(): {
3910
+ timeOrigin: number;
3911
+ };
3912
+ /** @internal */
3913
+ private _resolveTimestamp;
3560
3914
  }
3561
3915
  declare var performance: Performance;
3562
3916
  interface AmbientLightSensorOptions {
@@ -3575,6 +3929,7 @@ interface AmbientLightSensorOptions {
3575
3929
  * @see https://developer.mozilla.org/docs/Web/API/AmbientLightSensor
3576
3930
  */
3577
3931
  declare class AmbientLightSensor extends Sensor {
3932
+ #private;
3578
3933
  /**
3579
3934
  * @see https://developer.mozilla.org/docs/Web/API/AmbientLightSensor/AmbientLightSensor
3580
3935
  */
@@ -3591,60 +3946,6 @@ declare class AmbientLightSensor extends Sensor {
3591
3946
  start(): void;
3592
3947
  stop(): void;
3593
3948
  }
3594
- declare class DOMException extends Error {
3595
- INDEX_SIZE_ERR: 1;
3596
- DOMSTRING_SIZE_ERR: 2;
3597
- HIERARCHY_REQUEST_ERR: 3;
3598
- WRONG_DOCUMENT_ERR: 4;
3599
- INVALID_CHARACTER_ERR: 5;
3600
- NO_DATA_ALLOWED_ERR: 6;
3601
- NO_MODIFICATION_ALLOWED_ERR: 7;
3602
- NOT_FOUND_ERR: 8;
3603
- NOT_SUPPORTED_ERR: 9;
3604
- INUSE_ATTRIBUTE_ERR: 10;
3605
- INVALID_STATE_ERR: 11;
3606
- SYNTAX_ERR: 12;
3607
- INVALID_MODIFICATION_ERR: 13;
3608
- NAMESPACE_ERR: 14;
3609
- INVALID_ACCESS_ERR: 15;
3610
- VALIDATION_ERR: 16;
3611
- TYPE_MISMATCH_ERR: 17;
3612
- SECURITY_ERR: 18;
3613
- NETWORK_ERR: 19;
3614
- ABORT_ERR: 20;
3615
- URL_MISMATCH_ERR: 21;
3616
- QUOTA_EXCEEDED_ERR: 22;
3617
- TIMEOUT_ERR: 23;
3618
- INVALID_NODE_TYPE_ERR: 24;
3619
- DATA_CLONE_ERR: 25;
3620
- static INDEX_SIZE_ERR: 1;
3621
- static DOMSTRING_SIZE_ERR: 2;
3622
- static HIERARCHY_REQUEST_ERR: 3;
3623
- static WRONG_DOCUMENT_ERR: 4;
3624
- static INVALID_CHARACTER_ERR: 5;
3625
- static NO_DATA_ALLOWED_ERR: 6;
3626
- static NO_MODIFICATION_ALLOWED_ERR: 7;
3627
- static NOT_FOUND_ERR: 8;
3628
- static NOT_SUPPORTED_ERR: 9;
3629
- static INUSE_ATTRIBUTE_ERR: 10;
3630
- static INVALID_STATE_ERR: 11;
3631
- static SYNTAX_ERR: 12;
3632
- static INVALID_MODIFICATION_ERR: 13;
3633
- static NAMESPACE_ERR: 14;
3634
- static INVALID_ACCESS_ERR: 15;
3635
- static VALIDATION_ERR: 16;
3636
- static TYPE_MISMATCH_ERR: 17;
3637
- static SECURITY_ERR: 18;
3638
- static NETWORK_ERR: 19;
3639
- static ABORT_ERR: 20;
3640
- static URL_MISMATCH_ERR: 21;
3641
- static QUOTA_EXCEEDED_ERR: 22;
3642
- static TIMEOUT_ERR: 23;
3643
- static INVALID_NODE_TYPE_ERR: 24;
3644
- static DATA_CLONE_ERR: 25;
3645
- code: number;
3646
- constructor(message?: string, name?: string);
3647
- }
3648
3949
  /**
3649
3950
  * Compression formats supported by {@link CompressionStream | `CompressionStream`} and {@link DecompressionStream | `DecompressionStream`}.
3650
3951
  */
@@ -3661,6 +3962,110 @@ declare class CompressionStream extends TransformStream<Uint8Array, Uint8Array>
3661
3962
  declare class DecompressionStream extends TransformStream<Uint8Array, Uint8Array> {
3662
3963
  constructor(format: CompressionFormat);
3663
3964
  }
3965
+ type BinaryType = "blob" | "arraybuffer";
3966
+ interface MessageEventInit extends EventInit {
3967
+ data?: any;
3968
+ origin?: string;
3969
+ lastEventId?: string;
3970
+ source?: any;
3971
+ ports?: any[];
3972
+ }
3973
+ declare class MessageEvent extends Event {
3974
+ readonly data: any;
3975
+ readonly origin: string;
3976
+ readonly lastEventId: string;
3977
+ readonly source: any;
3978
+ readonly ports: ReadonlyArray<any>;
3979
+ constructor(type: string, init?: MessageEventInit);
3980
+ }
3981
+ interface CloseEventInit extends EventInit {
3982
+ code?: number;
3983
+ reason?: string;
3984
+ wasClean?: boolean;
3985
+ }
3986
+ declare class CloseEvent extends Event {
3987
+ readonly code: number;
3988
+ readonly reason: string;
3989
+ readonly wasClean: boolean;
3990
+ constructor(type: string, init?: CloseEventInit);
3991
+ }
3992
+ /**
3993
+ * The `WebSocket` object provides the API for creating and managing a
3994
+ * WebSocket connection to a server, as well as for sending and receiving
3995
+ * data on the connection.
3996
+ *
3997
+ * @see https://developer.mozilla.org/docs/Web/API/WebSocket
3998
+ */
3999
+ declare class WebSocket extends EventTarget {
4000
+ #private;
4001
+ static readonly CONNECTING = 0;
4002
+ static readonly OPEN = 1;
4003
+ static readonly CLOSING = 2;
4004
+ static readonly CLOSED = 3;
4005
+ readonly CONNECTING = 0;
4006
+ readonly OPEN = 1;
4007
+ readonly CLOSING = 2;
4008
+ readonly CLOSED = 3;
4009
+ onopen: ((this: WebSocket, ev: Event) => any) | null;
4010
+ onmessage: ((this: WebSocket, ev: MessageEvent) => any) | null;
4011
+ onerror: ((this: WebSocket, ev: Event) => any) | null;
4012
+ onclose: ((this: WebSocket, ev: CloseEvent) => any) | null;
4013
+ /**
4014
+ * Creates a new WebSocket connection to the given URL.
4015
+ *
4016
+ * @param url The URL to connect to. Must use `ws:` or `wss:` protocol.
4017
+ * @param protocols Optional subprotocol(s) to request.
4018
+ * @see https://developer.mozilla.org/docs/Web/API/WebSocket/WebSocket
4019
+ */
4020
+ constructor(url: string | URL, protocols?: string | string[]);
4021
+ /**
4022
+ * The current state of the connection.
4023
+ * @see https://developer.mozilla.org/docs/Web/API/WebSocket/readyState
4024
+ */
4025
+ get readyState(): number;
4026
+ /**
4027
+ * The number of bytes of data that have been queued using calls to `send()`
4028
+ * but not yet transmitted to the network.
4029
+ * @see https://developer.mozilla.org/docs/Web/API/WebSocket/bufferedAmount
4030
+ */
4031
+ get bufferedAmount(): number;
4032
+ /**
4033
+ * The sub-protocol selected by the server.
4034
+ * @see https://developer.mozilla.org/docs/Web/API/WebSocket/protocol
4035
+ */
4036
+ get protocol(): string;
4037
+ /**
4038
+ * The extensions selected by the server.
4039
+ * @see https://developer.mozilla.org/docs/Web/API/WebSocket/extensions
4040
+ */
4041
+ get extensions(): string;
4042
+ /**
4043
+ * The absolute URL of the WebSocket.
4044
+ * @see https://developer.mozilla.org/docs/Web/API/WebSocket/url
4045
+ */
4046
+ get url(): string;
4047
+ /**
4048
+ * The type of binary data being received over the connection.
4049
+ * @see https://developer.mozilla.org/docs/Web/API/WebSocket/binaryType
4050
+ */
4051
+ get binaryType(): BinaryType;
4052
+ set binaryType(value: BinaryType);
4053
+ /**
4054
+ * Enqueues the specified data to be transmitted to the server over the WebSocket connection.
4055
+ *
4056
+ * @param data The data to send: string, ArrayBuffer, ArrayBufferView, or Blob.
4057
+ * @see https://developer.mozilla.org/docs/Web/API/WebSocket/send
4058
+ */
4059
+ send(data: string | ArrayBufferLike | ArrayBufferView | Blob): void;
4060
+ /**
4061
+ * Closes the WebSocket connection or connection attempt, if any.
4062
+ *
4063
+ * @param code A numeric value indicating the status code. If not specified, 1000 is used.
4064
+ * @param reason A human-readable string explaining why the connection is closing.
4065
+ * @see https://developer.mozilla.org/docs/Web/API/WebSocket/close
4066
+ */
4067
+ close(code?: number, reason?: string): void;
4068
+ }
3664
4069
  /**
3665
4070
  * The `import.meta` meta-property exposes context-specific metadata to a JavaScript module.
3666
4071
  * It contains information about the module, such as the module's URL.
@@ -3689,6 +4094,57 @@ interface ImportMeta {
3689
4094
  */
3690
4095
  declare function queueMicrotask(callback: () => void): void;
3691
4096
 
4097
+ interface Uint8Array {
4098
+ /**
4099
+ * Returns a base64-encoded string of this `Uint8Array`'s data.
4100
+ *
4101
+ * @param options An optional object with `alphabet` (`"base64"` or `"base64url"`) and `omitPadding` (boolean) properties.
4102
+ * @see https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array/toBase64
4103
+ */
4104
+ toBase64(options?: Uint8ArrayToBase64Options): string;
4105
+ /**
4106
+ * Returns a hex-encoded string of this `Uint8Array`'s data.
4107
+ *
4108
+ * @see https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array/toHex
4109
+ */
4110
+ toHex(): string;
4111
+ /**
4112
+ * Populates this `Uint8Array` with bytes from a base64-encoded string.
4113
+ *
4114
+ * @param string A base64-encoded string.
4115
+ * @param options An optional object with `alphabet` and `lastChunkHandling` properties.
4116
+ * @returns An object with `read` (characters consumed) and `written` (bytes written) properties.
4117
+ * @see https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array/setFromBase64
4118
+ */
4119
+ setFromBase64(string: string, options?: Uint8ArrayFromBase64Options): Uint8ArraySetFromResult;
4120
+ /**
4121
+ * Populates this `Uint8Array` with bytes from a hex-encoded string.
4122
+ *
4123
+ * @param string A hex-encoded string.
4124
+ * @returns An object with `read` (characters consumed) and `written` (bytes written) properties.
4125
+ * @see https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array/setFromHex
4126
+ */
4127
+ setFromHex(string: string): Uint8ArraySetFromResult;
4128
+ }
4129
+
4130
+ interface Uint8ArrayConstructor {
4131
+ /**
4132
+ * Creates a new `Uint8Array` from a base64-encoded string.
4133
+ *
4134
+ * @param base64 A base64-encoded string.
4135
+ * @param options An optional object with `alphabet` and `lastChunkHandling` properties.
4136
+ * @see https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array/fromBase64
4137
+ */
4138
+ fromBase64(base64: string, options?: Uint8ArrayFromBase64Options): Uint8Array;
4139
+ /**
4140
+ * Creates a new `Uint8Array` from a hex-encoded string.
4141
+ *
4142
+ * @param hex A hex-encoded string.
4143
+ * @see https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array/fromHex
4144
+ */
4145
+ fromHex(hex: string): Uint8Array;
4146
+ }
4147
+
3692
4148
  /**
3693
4149
  * The `Switch` global object contains native interfaces to interact with the Switch hardware.
3694
4150
  */
@@ -3921,6 +4377,144 @@ declare namespace Switch {
3921
4377
  stream(opts?: FsFileStreamOptions): ReadableStream<Uint8Array>;
3922
4378
  get writable(): WritableStream<string | BufferSource>;
3923
4379
  }
4380
+ /**
4381
+ * Options for creating a datagram socket.
4382
+ *
4383
+ * @see {@link listenDatagram | `Switch.listenDatagram()`}
4384
+ */
4385
+ interface DatagramOptions {
4386
+ /**
4387
+ * The port number to bind to. Pass `0` or omit for a random port.
4388
+ *
4389
+ * @default 0
4390
+ */
4391
+ port?: number;
4392
+ /**
4393
+ * The IP address of the network interface to bind to.
4394
+ *
4395
+ * @default "0.0.0.0"
4396
+ */
4397
+ ip?: string;
4398
+ /**
4399
+ * Handler invoked when a datagram is received.
4400
+ *
4401
+ * This is a shorthand for:
4402
+ * ```js
4403
+ * socket.addEventListener('message', handler);
4404
+ * ```
4405
+ */
4406
+ message?: (e: DatagramEvent) => void;
4407
+ }
4408
+ /**
4409
+ * Init data for a received datagram.
4410
+ */
4411
+ interface DatagramEventInit extends EventInit {
4412
+ /** The received data. */
4413
+ data: ArrayBuffer;
4414
+ /** The sender's IP address. */
4415
+ remoteAddress: string;
4416
+ /** The sender's port number. */
4417
+ remotePort: number;
4418
+ }
4419
+ /**
4420
+ * Event dispatched when a datagram is received on a {@link DatagramSocket | `DatagramSocket`}.
4421
+ */
4422
+ declare class DatagramEvent extends Event {
4423
+ /** The received data. */
4424
+ readonly data: ArrayBuffer;
4425
+ /** The sender's IP address. */
4426
+ readonly remoteAddress: string;
4427
+ /** The sender's port number. */
4428
+ readonly remotePort: number;
4429
+ constructor(type: string, init: DatagramEventInit);
4430
+ }
4431
+ /**
4432
+ * A UDP datagram socket bound to a local address and port.
4433
+ *
4434
+ * Uses the Web `EventTarget` API. Dispatches {@link DatagramEvent | `DatagramEvent`}
4435
+ * instances when datagrams are received.
4436
+ *
4437
+ * @example
4438
+ * ```typescript
4439
+ * const socket = Switch.listenDatagram({ port: 9999 });
4440
+ *
4441
+ * socket.addEventListener('message', (e) => {
4442
+ * console.log(`From ${e.remoteAddress}:${e.remotePort}:`, e.data);
4443
+ * socket.send('pong', e.remoteAddress, e.remotePort);
4444
+ * });
4445
+ * ```
4446
+ */
4447
+ declare class DatagramSocket extends EventTarget {
4448
+ /**
4449
+ * The file descriptor of the underlying socket.
4450
+ * Set by the native `$.udpInit` via a getter on the prototype.
4451
+ * @internal
4452
+ */
4453
+ readonly fd: number;
4454
+ /**
4455
+ * The local address information of the bound socket.
4456
+ * Set by the native `$.udpInit` via a getter on the prototype.
4457
+ * @internal
4458
+ */
4459
+ readonly address: {
4460
+ address: string;
4461
+ port: number;
4462
+ };
4463
+ /**
4464
+ * Send a datagram to the specified address and port.
4465
+ *
4466
+ * @param data The data to send. Strings are encoded as UTF-8.
4467
+ * @param remoteAddress The destination IP address.
4468
+ * @param remotePort The destination port number.
4469
+ */
4470
+ send(data: Uint8Array | ArrayBuffer | string, remoteAddress: string, remotePort: number): Promise<number>;
4471
+ /**
4472
+ * Enable or disable broadcast on this socket.
4473
+ *
4474
+ * @param enabled Whether to enable broadcast.
4475
+ */
4476
+ setBroadcast(enabled: boolean): void;
4477
+ /**
4478
+ * Join a multicast group.
4479
+ *
4480
+ * @param multicastAddress The multicast group address to join (e.g. `"239.255.255.250"`).
4481
+ * @param multicastInterface The local interface address to use. Defaults to `"0.0.0.0"` (any interface).
4482
+ */
4483
+ addMembership(multicastAddress: string, multicastInterface?: string): void;
4484
+ /**
4485
+ * Leave a multicast group.
4486
+ *
4487
+ * @param multicastAddress The multicast group address to leave.
4488
+ * @param multicastInterface The local interface address. Defaults to `"0.0.0.0"`.
4489
+ */
4490
+ dropMembership(multicastAddress: string, multicastInterface?: string): void;
4491
+ /**
4492
+ * Close the socket. No more datagrams will be received or sent.
4493
+ */
4494
+ close(): void;
4495
+ }
4496
+ /**
4497
+ * Creates a UDP datagram socket bound to the specified port.
4498
+ *
4499
+ * @param opts Options for the datagram socket.
4500
+ * @returns The bound datagram socket.
4501
+ *
4502
+ * @example
4503
+ * ```typescript
4504
+ * const socket = Switch.listenDatagram({
4505
+ * port: 9999,
4506
+ * message(e) {
4507
+ * console.log(`From ${e.remoteAddress}:${e.remotePort}`);
4508
+ * socket.send('pong', e.remoteAddress, e.remotePort);
4509
+ * },
4510
+ * });
4511
+ *
4512
+ * // Send a broadcast
4513
+ * socket.setBroadcast(true);
4514
+ * socket.send('hello', '255.255.255.255', 9999);
4515
+ * ```
4516
+ */
4517
+ declare function listenDatagram(opts: DatagramOptions): DatagramSocket;
3924
4518
  /**
3925
4519
  * The `Switch.Album` class allows for interacting with the Switch's photo gallery,
3926
4520
  * providing access to the screenshots / video recordings that the user has saved.
@@ -4627,6 +5221,7 @@ declare namespace Switch {
4627
5221
  readonly libnx: string;
4628
5222
  readonly mbedtls: string;
4629
5223
  readonly nxjs: string;
5224
+ readonly pixman: string;
4630
5225
  readonly png: string;
4631
5226
  readonly quickjs: string;
4632
5227
  readonly turbojpeg: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx.js/runtime",
3
- "version": "0.0.68",
3
+ "version": "0.0.69",
4
4
  "description": "nx.js runtime",
5
5
  "repository": {
6
6
  "type": "git",
@@ -21,20 +21,25 @@
21
21
  "@jridgewell/trace-mapping": "^0.3.20",
22
22
  "@types/color-rgba": "^2.1.2",
23
23
  "@types/to-px": "^1.1.4",
24
+ "bun": "^1.3.0",
24
25
  "color-rgba": "^2.4.0",
25
26
  "data-uri-to-buffer": "^6.0.1",
26
27
  "dts-bundle-generator": "^8.1.2",
27
- "esbuild": "^0.17.19",
28
+ "esbuild": "^0.27.3",
28
29
  "kleur": "github:TooTallNate/kleur#rgb",
29
30
  "parse-css-font": "^4.0.0",
31
+ "playwright": "^1.50.0",
30
32
  "to-px": "^1.1.0",
33
+ "vitest": "^3.0.0",
31
34
  "web-streams-polyfill": "^4.0.0",
32
- "@nx.js/inspect": "0.0.1"
35
+ "@nx.js/inspect": "0.0.1",
36
+ "@nx.js/ws": "0.0.2"
33
37
  },
34
38
  "scripts": {
35
39
  "build": "node build.mjs",
36
40
  "bundle": "node bundle.mjs",
37
41
  "bundle-minify": "MINIFY=1 node bundle.mjs",
38
- "docs": "typedoc && ../../type-aliases-meta.sh"
42
+ "docs": "typedoc && ../../type-aliases-meta.sh",
43
+ "test": "node test/build-fixtures.mjs && vitest run --config test/vitest.config.ts"
39
44
  }
40
45
  }