diff --git a/api/README.md b/api/README.md index fbde1f2601..aecf253bb2 100644 --- a/api/README.md +++ b/api/README.md @@ -498,7 +498,7 @@ A murmur3 hash implementation based on https://github.com/jwerle/murmurhash.c import { createSocket } from 'socket:dgram' ``` -## [`createSocket(options, callback)`](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/dgram.js#L660) +## [`createSocket(options, callback)`](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/dgram.js#L662) Creates a `Socket` instance. @@ -517,12 +517,12 @@ Creates a `Socket` instance. | :--- | :--- | :--- | | Not specified | Socket | | -## [`Socket` (extends `EventEmitter`)](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/dgram.js#L666) +## [`Socket` (extends `EventEmitter`)](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/dgram.js#L668) New instances of dgram.Socket are created using dgram.createSocket(). The new keyword is not to be used to create dgram.Socket instances. -### [`bind(port, address, callback)`](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/dgram.js#L747) +### [`bind(port, address, callback)`](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/dgram.js#L752) External docs: https://nodejs.org/api/dgram.html#socketbindport-address-callback Listen for datagram messages on a named port and optional address @@ -539,7 +539,7 @@ Listen for datagram messages on a named port and optional address | address | string | | false | The address to bind to (0.0.0.0) | | callback | function | | false | With no parameters. Called when binding is complete. | -### [`connect(port, host, connectListener)`](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/dgram.js#L862) +### [`connect(port, host, connectListener)`](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/dgram.js#L873) External docs: https://nodejs.org/api/dgram.html#socketconnectport-address-callback Associates the dgram.Socket to a remote address and port. Every message sent @@ -559,7 +559,7 @@ Associates the dgram.Socket to a remote address and port. Every message sent | host | string | | true | Host the client should connect to. | | connectListener | function | | true | Common parameter of socket.connect() methods. Will be added as a listener for the 'connect' event once. | -### [`disconnect()`](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/dgram.js#L899) +### [`disconnect()`](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/dgram.js#L910) External docs: https://nodejs.org/api/dgram.html#socketdisconnect A synchronous function that disassociates a connected dgram.Socket from @@ -567,7 +567,7 @@ A synchronous function that disassociates a connected dgram.Socket from disconnected socket will result in an ERR_SOCKET_DGRAM_NOT_CONNECTED exception. -### [`send(msg, offset, length, port, address, callback)`](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/dgram.js#L958) +### [`send(msg, offset, length, port, address, callback)`](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/dgram.js#L969) External docs: https://nodejs.org/api/dgram.html#socketsendmsg-offset-length-port-address-callback Broadcasts a datagram on the socket. For connectionless sockets, the @@ -618,7 +618,7 @@ Broadcasts a datagram on the socket. For connectionless sockets, the | address | string | | true | Destination host name or IP address. | | callback | Function | | true | Called when the message has been sent. | -### [`close(callback)`](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/dgram.js#L1056) +### [`close(callback)`](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/dgram.js#L1067) External docs: https://nodejs.org/api/dgram.html#socketclosecallback Close the underlying socket and stop listening for data on it. If a @@ -630,7 +630,7 @@ Close the underlying socket and stop listening for data on it. If a | :--- | :--- | :---: | :---: | :--- | | callback | function | | true | Called when the connection is completed or on error. | -### [`address()`](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/dgram.js#L1128) +### [`address()`](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/dgram.js#L1143) External docs: https://nodejs.org/api/dgram.html#socketaddress Returns an object containing the address information for a socket. For @@ -646,7 +646,7 @@ Returns an object containing the address information for a socket. For | socketInfo.port | string | The port of the socket | | socketInfo.family | string | The IP family of the socket | -### [`remoteAddress()`](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/dgram.js#L1163) +### [`remoteAddress()`](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/dgram.js#L1178) External docs: https://nodejs.org/api/dgram.html#socketremoteaddress Returns an object containing the address, family, and port of the remote @@ -661,7 +661,7 @@ Returns an object containing the address, family, and port of the remote | socketInfo.port | string | The port of the socket | | socketInfo.family | string | The IP family of the socket | -### [`setRecvBufferSize(size)`](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/dgram.js#L1194) +### [`setRecvBufferSize(size)`](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/dgram.js#L1209) External docs: https://nodejs.org/api/dgram.html#socketsetrecvbuffersizesize Sets the SO_RCVBUF socket option. Sets the maximum socket receive buffer in @@ -672,7 +672,7 @@ Sets the SO_RCVBUF socket option. Sets the maximum socket receive buffer in | :--- | :--- | :---: | :---: | :--- | | size | number | | false | The size of the new receive buffer | -### [`setSendBufferSize(size)`](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/dgram.js#L1211) +### [`setSendBufferSize(size)`](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/dgram.js#L1226) External docs: https://nodejs.org/api/dgram.html#socketsetsendbuffersizesize Sets the SO_SNDBUF socket option. Sets the maximum socket send buffer in @@ -683,12 +683,12 @@ Sets the SO_SNDBUF socket option. Sets the maximum socket send buffer in | :--- | :--- | :---: | :---: | :--- | | size | number | | false | The size of the new send buffer | -### [`getRecvBufferSize()`](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/dgram.js#L1224) +### [`getRecvBufferSize()`](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/dgram.js#L1239) External docs: https://nodejs.org/api/dgram.html#socketgetrecvbuffersize -### [`getSendBufferSize()`](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/dgram.js#L1232) +### [`getSendBufferSize()`](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/dgram.js#L1247) External docs: https://nodejs.org/api/dgram.html#socketgetsendbuffersize @@ -697,31 +697,31 @@ External docs: https://nodejs.org/api/dgram.html#socketgetsendbuffersize | :--- | :--- | :--- | | Not specified | number | the SO_SNDBUF socket send buffer size in bytes. | -### [`code()`](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/dgram.js#L1300) +### [`code()`](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/dgram.js#L1315) -## [`ERR_SOCKET_ALREADY_BOUND` (extends `SocketError`)](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/dgram.js#L1306) +## [`ERR_SOCKET_ALREADY_BOUND` (extends `SocketError`)](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/dgram.js#L1321) Thrown when a socket is already bound. -## [`ERR_SOCKET_DGRAM_IS_CONNECTED` (extends `SocketError`)](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/dgram.js#L1323) +## [`ERR_SOCKET_DGRAM_IS_CONNECTED` (extends `SocketError`)](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/dgram.js#L1338) Thrown when the socket is already connected. -## [`ERR_SOCKET_DGRAM_NOT_CONNECTED` (extends `SocketError`)](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/dgram.js#L1330) +## [`ERR_SOCKET_DGRAM_NOT_CONNECTED` (extends `SocketError`)](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/dgram.js#L1345) Thrown when the socket is not connected. -## [`ERR_SOCKET_DGRAM_NOT_RUNNING` (extends `SocketError`)](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/dgram.js#L1338) +## [`ERR_SOCKET_DGRAM_NOT_RUNNING` (extends `SocketError`)](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/dgram.js#L1353) Thrown when the socket is not running (not bound or connected). -## [`ERR_SOCKET_BAD_TYPE` (extends `TypeError`)](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/dgram.js#L1345) +## [`ERR_SOCKET_BAD_TYPE` (extends `TypeError`)](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/dgram.js#L1360) Thrown when a bad socket type is used in an argument. -## [`ERR_SOCKET_BAD_PORT` (extends `RangeError`)](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/dgram.js#L1355) +## [`ERR_SOCKET_BAD_PORT` (extends `RangeError`)](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/dgram.js#L1370) Thrown when a bad port is given. @@ -1710,17 +1710,17 @@ Watch for changes at `path` calling `callback` import { send } from 'socket:ipc' ``` -## [`maybeMakeError()`](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/ipc.js#L270) +## [`maybeMakeError()`](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/ipc.js#L280) This is a `FunctionDeclaration` named `maybeMakeError` in `api/ipc.js`, it's exported but undocumented. -## [`IPCSearchParams` (extends `URLSearchParams`)](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/ipc.js#L1026) +## [`IPCSearchParams` (extends `URLSearchParams`)](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/ipc.js#L1036) This is a `ClassDeclaration` named ``IPCSearchParams` (extends `URLSearchParams`)` in `api/ipc.js`, it's exported but undocumented. -## [`emit(name, value, target, options)`](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/ipc.js#L1192) +## [`emit(name, value, target, options)`](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/ipc.js#L1202) Emit event to be dispatched on `window` object. @@ -1731,7 +1731,7 @@ Emit event to be dispatched on `window` object. | target | EventTarget | window | true | | | options | Object | | true | | -## [`send(command, value, options)`](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/ipc.js#L1251) +## [`send(command, value, options)`](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/ipc.js#L1261) Sends an async IPC command request with parameters. @@ -1747,27 +1747,27 @@ Sends an async IPC command request with parameters. | :--- | :--- | :--- | | Not specified | Promise | | -## [`inflateIPCMessageTransfers()`](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/ipc.js#L1702) +## [`inflateIPCMessageTransfers()`](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/ipc.js#L1712) This is a `FunctionDeclaration` named `inflateIPCMessageTransfers` in `api/ipc.js`, it's exported but undocumented. -## [`findIPCMessageTransfers()`](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/ipc.js#L1734) +## [`findIPCMessageTransfers()`](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/ipc.js#L1744) This is a `FunctionDeclaration` named `findIPCMessageTransfers` in `api/ipc.js`, it's exported but undocumented. -## [ports](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/ipc.js#L1783) +## [ports](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/ipc.js#L1793) This is a `VariableDeclaration` named `ports` in `api/ipc.js`, it's exported but undocumented. -## [`IPCMessagePort` (extends `MessagePort`)](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/ipc.js#L1785) +## [`IPCMessagePort` (extends `MessagePort`)](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/ipc.js#L1795) This is a `ClassDeclaration` named ``IPCMessagePort` (extends `MessagePort`)` in `api/ipc.js`, it's exported but undocumented. -## [`IPCMessageChannel` (extends `MessageChannel`)](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/ipc.js#L1990) +## [`IPCMessageChannel` (extends `MessageChannel`)](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/ipc.js#L2000) This is a `ClassDeclaration` named ``IPCMessageChannel` (extends `MessageChannel`)` in `api/ipc.js`, it's exported but undocumented. diff --git a/api/index.d.ts b/api/index.d.ts index b70a36af51..5bcf959953 100644 --- a/api/index.d.ts +++ b/api/index.d.ts @@ -127,7 +127,7 @@ declare module "socket:async/context" { * @param {Variable} key * @return {boolean} */ - get(key: Variable): boolean; + get(key: Variable): boolean; /** * Sets an `AsyncContext.Variable` value at `key`. If the `Mapping` is frozen, * then a "forked" (new) instance with the value set on it is returned, @@ -137,7 +137,7 @@ declare module "socket:async/context" { * @param {T} value * @return {Mapping} */ - set(key: Variable, value: T_2): Mapping; + set(key: Variable, value: T): Mapping; /** * Delete an `AsyncContext.Variable` value at `key`. * If the `Mapping` is frozen, then a "forked" (new) instance is returned, @@ -147,7 +147,7 @@ declare module "socket:async/context" { * @param {T} value * @return {Mapping} */ - delete(key: Variable): Mapping; + delete(key: Variable): Mapping; #private; } /** @@ -177,7 +177,7 @@ declare module "socket:async/context" { * @param {Variable} key * @return {T|undefined} */ - static get(key: Variable): T_1; + static get(key: Variable): T | undefined; /** * Set updates the `AsyncContext.Variable` with a new value and returns a * revert action that allows the modification to be reversed in the future. @@ -186,7 +186,7 @@ declare module "socket:async/context" { * @param {T} value * @return {Revert|FrozenRevert} */ - static set(key: Variable, value: T_2): FrozenRevert | Revert; + static set(key: Variable, value: T): Revert | FrozenRevert; /** * "Freezes" the current storage `Mapping`, and returns a new `FrozenRevert` * or `Revert` which can restore the storage state to the state at @@ -200,7 +200,7 @@ declare module "socket:async/context" { * @template T * @param {Revert|FrozenRevert} revert */ - static restore(revert: FrozenRevert | Revert): void; + static restore(revert: Revert | FrozenRevert): void; /** * Switches storage `Mapping` state to the state at the time of a * "snapshot". @@ -254,7 +254,7 @@ declare module "socket:async/context" { * @template T * @return {T|undefined} */ - get(): T_2; + get(): T_1 | undefined; #private; } /** @@ -282,7 +282,7 @@ declare module "socket:async/context" { * @param {F} fn * @returns {F} */ - static wrap(fn: F_1): F_1; + static wrap(fn: F): F; /** * Runs the given function `fn` with arguments `args`, using a `null` * context and the current snapshot. @@ -340,7 +340,7 @@ declare module "socket:events" { }; export const CustomEvent: { new (type: string, eventInitDict?: CustomEventInit): CustomEvent; - prototype: CustomEvent; + prototype: CustomEvent; } | { new (type: any, options: any): { "__#7@#detail": any; @@ -349,7 +349,7 @@ declare module "socket:events" { }; export const MessageEvent: { new (type: string, eventInitDict?: MessageEventInit): MessageEvent; - prototype: MessageEvent; + prototype: MessageEvent; } | { new (type: any, options: any): { "__#8@#detail": any; @@ -402,6 +402,39 @@ declare module "socket:events" { export function once(emitter: any, name: any): Promise; } +declare module "socket:url/urlpattern/urlpattern" { + export { me as URLPattern }; + var me: { + new (t: {}, r: any, n: any): { + "__#11@#i": any; + "__#11@#n": {}; + "__#11@#t": {}; + "__#11@#e": {}; + "__#11@#s": {}; + "__#11@#l": boolean; + test(t: {}, r: any): boolean; + exec(t: {}, r: any): { + inputs: any[] | {}[]; + }; + readonly protocol: any; + readonly username: any; + readonly password: any; + readonly hostname: any; + readonly port: any; + readonly pathname: any; + readonly search: any; + readonly hash: any; + readonly hasRegExpGroups: boolean; + }; + compareComponent(t: any, r: any, n: any): number; + }; +} + +declare module "socket:url/url/url" { + const _default: any; + export default _default; +} + declare module "socket:buffer" { export default Buffer; export const File: { @@ -565,58 +598,6 @@ declare module "socket:buffer" { function byteLength(string: any, encoding: any, ...args: any[]): any; } -declare module "socket:fs/bookmarks" { - /** - * A map of known absolute file paths to file IDs that - * have been granted access outside of the sandbox. - * XXX(@jwerle): this is currently only used on linux, but valaues may - * be added for all platforms, likely from a file system picker dialog. - * @type {Map} - */ - export const temporary: Map; - namespace _default { - export { temporary }; - } - export default _default; -} - -declare module "socket:internal/serialize" { - export default function serialize(value: any): any; -} - -declare module "socket:url/urlpattern/urlpattern" { - export { me as URLPattern }; - var me: { - new (t: {}, r: any, n: any): { - "__#11@#i": any; - "__#11@#n": {}; - "__#11@#t": {}; - "__#11@#e": {}; - "__#11@#s": {}; - "__#11@#l": boolean; - test(t: {}, r: any): boolean; - exec(t: {}, r: any): { - inputs: any[] | {}[]; - }; - readonly protocol: any; - readonly username: any; - readonly password: any; - readonly hostname: any; - readonly port: any; - readonly pathname: any; - readonly search: any; - readonly hash: any; - readonly hasRegExpGroups: boolean; - }; - compareComponent(t: any, r: any, n: any): number; - }; -} - -declare module "socket:url/url/url" { - const _default: any; - export default _default; -} - declare module "socket:querystring" { export function unescapeBuffer(s: any, decodeSpaces: any): any; export function unescape(s: any, decodeSpaces: any): any; @@ -656,7 +637,12 @@ declare module "socket:url/index" { export function resolve(from: any, to: any): any; export function format(input: any): any; export function fileURLToPath(url: any): any; - export const protocols: Set; + /** + * @type {Set & { handlers: Set }} + */ + export const protocols: Set & { + handlers: Set; + }; export default URL; export class URL { private constructor(); @@ -673,6 +659,43 @@ declare module "socket:url" { import URL from "socket:url/index"; } +declare module "socket:fs/bookmarks" { + /** + * A map of known absolute file paths to file IDs that + * have been granted access outside of the sandbox. + * XXX(@jwerle): this is currently only used on linux, but valaues may + * be added for all platforms, likely from a file system picker dialog. + * @type {Map} + */ + export const temporary: Map; + namespace _default { + export { temporary }; + } + export default _default; +} + +declare module "socket:internal/serialize" { + export default function serialize(value: any): any; +} + +declare module "socket:location" { + export class Location { + get url(): URL; + get protocol(): string; + get host(): string; + get hostname(): string; + get port(): string; + get pathname(): string; + get search(): string; + get origin(): string; + get href(): string; + get hash(): string; + toString(): string; + } + const _default: Location; + export default _default; +} + declare module "socket:internal/symbols" { export const dispose: any; export const serialize: any; @@ -1397,7 +1420,7 @@ declare module "socket:errors" { * `ErrnoError` class constructor. * @param {import('./errno').errno|string} code */ - constructor(code: import('./errno').errno | string, message?: any, ...args: any[]); + constructor(code: import("socket:errno").errno | string, message?: any, ...args: any[]); get name(): string; get code(): number; #private; @@ -2164,7 +2187,7 @@ declare module "socket:util" { export function isTypedArray(object: any): boolean; export function isArrayLike(input: any): boolean; export function isError(object: any): boolean; - export function isSymbol(value: any): boolean; + export function isSymbol(value: any): value is symbol; export function isNumber(value: any): boolean; export function isBoolean(value: any): boolean; export function isArrayBufferView(buf: any): boolean; @@ -2840,7 +2863,7 @@ declare module "socket:internal/events" { * @param {object=} [data] * @param {import('../application/menu.js').Menu} menu */ - constructor(type?: string | undefined, data?: object | undefined, menu?: import('../application/menu.js').Menu); + constructor(type?: string | undefined, data?: object | undefined, menu?: import("socket:application/menu").Menu); /** * The `Menu` this event has been dispatched for. * @type {import('../application/menu.js').Menu?} @@ -3081,7 +3104,7 @@ declare module "socket:os" { * @ignore * @return {'android'|'android-emulator'|'iphoneos'|iphone-simulator'|'linux'|'macosx'|unix'|unknown'|win32'} */ - export function host(): 'android' | 'android-emulator' | 'iphoneos' | iphone; + export function host(): "android" | "android-emulator" | "iphoneos" | iphone; /** * Returns the home directory of the current user. * @return {string} @@ -3111,7 +3134,7 @@ declare module "socket:process/signal" { * @param {string|number} name * @return {signal} */ - export function getCode(name: string | number): any; + export function getCode(name: string | number): signal; /** * Gets the name for a given 'signal' code * @return {string} @@ -3255,7 +3278,7 @@ declare module "socket:internal/streams/web" { constructor(e?: {}, t?: {}); get locked(): boolean; cancel(e?: any): any; - getReader(e?: any): ReadableStreamDefaultReader | ReadableStreamBYOBReader; + getReader(e?: any): ReadableStreamBYOBReader | ReadableStreamDefaultReader; pipeThrough(e: any, t?: {}): any; pipeTo(e: any, t?: {}): any; tee(): any; @@ -3636,29 +3659,11 @@ declare module "socket:process" { export class ProcessEnvironment extends EventTarget { get [Symbol.toStringTag](): string; } - export const env: any; + export const env: ProcessEnvironment; export default process; const process: any; } -declare module "socket:location" { - export class Location { - get url(): URL; - get protocol(): string; - get host(): string; - get hostname(): string; - get port(): string; - get pathname(): string; - get search(): string; - get origin(): string; - get href(): string; - get hash(): string; - toString(): string; - } - const _default: Location; - export default _default; -} - declare module "socket:path/path" { /** * The path.resolve() method resolves a sequence of paths or path segments into an absolute path. @@ -4546,9 +4551,9 @@ declare module "socket:diagnostics/window" { patched: { open: { (method: string, url: string | URL): void; - (method: string, url: string | URL, async: boolean, username?: string, password?: string): void; + (method: string, url: string | URL, async: boolean, username?: string | null, password?: string | null): void; }; - send: (body?: Document | XMLHttpRequestBodyInit) => void; + send: (body?: Document | XMLHttpRequestBodyInit | null) => void; }; } export class WorkerMetric extends Metric { @@ -4587,7 +4592,7 @@ declare module "socket:diagnostics/runtime" { * Queries runtime diagnostics. * @return {Promise} */ - export function query(): Promise; + export function query(type: any): Promise; /** * A base container class for diagnostic information. */ @@ -5276,7 +5281,7 @@ declare module "socket:fs/stats" { * @param {fromBigInt=} [fromBigInt = false] * @return {Stats} */ - static from(stat?: object | Stats, fromBigInt?: any): Stats; + static from(stat?: object | Stats, fromBigInt?: any | undefined): Stats; /** * `Stats` class constructor. * @param {object|Stats} stat @@ -6149,7 +6154,7 @@ declare module "socket:fs/watcher" { * The encoding of the `filename` * @type {'utf8'|'buffer'} */ - encoding: 'utf8' | 'buffer'; + encoding: "utf8" | "buffer"; /** * A `AbortController` `AbortSignal` for async aborts. * @type {AbortSignal?} @@ -6993,7 +6998,7 @@ declare module "socket:application/client" { * The frame type of the client. * @type {'top-level'|'nested'|'none'} */ - get frameType(): "none" | "nested" | "top-level"; + get frameType(): "none" | "top-level" | "nested"; /** * The type of the client. * @type {'window'|'worker'} @@ -7025,10 +7030,10 @@ declare module "socket:application/client" { export default _default; export type ClientState = { id?: string | null; - type?: 'window' | 'worker'; + type?: "window" | "worker"; parent?: object | null; top?: object | null; - frameType?: 'top-level' | 'nested' | 'none'; + frameType?: "top-level" | "nested" | "none"; }; } @@ -7102,7 +7107,7 @@ declare module "socket:window/hotkey" { * @ignore * @param {import('../internal/events.js').HotKeyEvent} event */ - onHotKey(event: import('../internal/events.js').HotKeyEvent): boolean; + onHotKey(event: import("socket:internal/events").HotKeyEvent): boolean; /** * The number of `Binding` instances in the mapping. * @type {number} @@ -7315,6 +7320,7 @@ declare module "socket:window/hotkey" { */ export const bindings: Bindings; export default bindings; + import { HotKeyEvent } from "socket:internal/events"; } declare module "socket:window" { @@ -8012,7 +8018,7 @@ declare module "socket:shared-worker/index" { export function getContextWindow(): Promise; export const SHARED_WORKER_WINDOW_INDEX: 46; export const SHARED_WORKER_WINDOW_TITLE: "socket:shared-worker"; - export const SHARED_WORKER_WINDOW_PATH: string; + export const SHARED_WORKER_WINDOW_PATH: "/socket/shared-worker/index.html"; export const channel: BroadcastChannel; export const workers: Map; export class SharedWorkerMessagePort extends ipc.IPCMessagePort { @@ -8039,7 +8045,7 @@ declare module "socket:internal/promise" { export const NativePromise: PromiseConstructor; export namespace NativePromisePrototype { export let then: (onfulfilled?: (value: any) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => globalThis.Promise; - let _catch: (onrejected?: (reason: any) => TResult | PromiseLike) => globalThis.Promise; + let _catch: (onrejected?: (reason: any) => TResult | PromiseLike) => globalThis.Promise; export { _catch as catch }; let _finally: (onfinally?: () => void) => globalThis.Promise; export { _finally as finally }; @@ -8085,9 +8091,9 @@ declare module "socket:internal/promise" { readonly destroyed: boolean; asyncId(): number; triggerAsyncId(): number; - emitDestroy(): asyncHooks.CoreAsyncResource; - bind(fn: Function, thisArg?: any): Function; - runInAsyncScope(fn: Function, thisArg?: any, ...args?: any[]): any; + emitDestroy(): CoreAsyncResource; + bind(fn: Function, thisArg?: object | undefined): Function; + runInAsyncScope(fn: Function, thisArg?: object | undefined, ...args?: any[]): any; }; } export namespace Promise { @@ -8707,7 +8713,7 @@ declare module "socket:worker_threads" { * @ignore * @param {import('./process.js').ProcessEnvironmentEvent} event */ - onProcessEnvironmentEvent(event: import('./process.js').ProcessEnvironmentEvent): void; + onProcessEnvironmentEvent(event: import("socket:process").ProcessEnvironmentEvent): void; /** * The unique ID for this `Worker` thread instace. * @type {number} @@ -9198,9 +9204,9 @@ declare module "socket:internal/conduit" { export const DEFAULT_MAX_RECONNECT_TIMEOUT: 256; /** * A pool of known `Conduit` instances. - * @type {Set>} + * @type {Set} */ - export const pool: Set>; + export const pool: Set; /** * A container for managing a WebSocket connection to the internal runtime * Conduit WebSocket server. @@ -9341,10 +9347,10 @@ declare module "socket:internal/conduit" { * Sends a message with the specified options and payload over the * WebSocket connection. * @param {object} options - The options to send. - * @param {Uint8Array} payload - The payload to send. + * @param {Uint8Array=} [payload] - The payload to send. * @return {boolean} */ - send(options: object, payload: Uint8Array): boolean; + send(options: object, payload?: Uint8Array | undefined): boolean; /** * Closes the WebSocket connection, preventing reconnects. */ @@ -9861,7 +9867,7 @@ declare module "socket:extension" { * @param {string} name * @return {Promise<'shared'|'wasm32'|'unknown'|null>} */ - static type(name: string): Promise<'shared' | 'wasm32' | 'unknown' | null>; + static type(name: string): Promise<"shared" | "wasm32" | "unknown" | null>; /** * Provides current stats about the loaded extensions or one by name. * @param {?string} name @@ -9936,7 +9942,7 @@ declare module "socket:extension" { export type ExtensionLoadOptions = { allow: string[] | string; imports?: object; - type?: 'shared' | 'wasm32'; + type?: "shared" | "wasm32"; path?: string; stats?: object; instance?: WebAssembly.Instance; @@ -10362,7 +10368,7 @@ declare module "socket:internal/database" { export type DatabasePutOptions = { store?: string | undefined; stores?: string[] | undefined; - durability?: 'strict' | 'relaxed' | undefined; + durability?: "strict" | "relaxed" | undefined; }; /** * A typed container for various optional options made to a `delete()` function @@ -10426,7 +10432,7 @@ declare module "socket:service-worker/env" { * @param {'set'|'delete'} type * @param {object=} [entry] */ - constructor(type: 'set' | 'delete', entry?: object | undefined); + constructor(type: "set" | "delete", entry?: object | undefined); entry: any; } /** @@ -10558,7 +10564,7 @@ declare module "socket:service-worker/context" { * `Context` class constructor. * @param {import('./events.js').ExtendableEvent} event */ - constructor(event: import('./events.js').ExtendableEvent); + constructor(event: import("socket:service-worker/events").ExtendableEvent); /** * Context data. This may be a custom protocol handler scheme data * by default, if available. @@ -10599,7 +10605,7 @@ declare module "socket:service-worker/context" { * Gets the client for this event context. * @return {Promise} */ - client(): Promise; + client(): Promise; #private; } namespace _default { @@ -10786,7 +10792,7 @@ declare module "socket:http/adapters" { * @param {import('../http.js').Server} server * @param {HTTPModuleInterface} httpInterface */ - constructor(server: import('../http.js').Server, httpInterface: HTTPModuleInterface); + constructor(server: import("socket:http").Server, httpInterface: HTTPModuleInterface); /** * A readonly reference to the underlying HTTP(S) server * for this adapter. @@ -10821,13 +10827,13 @@ declare module "socket:http/adapters" { * @ignore * @param {import('../service-worker/events.js').ExtendableEvent} event */ - onInstall(event: import('../service-worker/events.js').ExtendableEvent): Promise; + onInstall(event: import("socket:service-worker/events").ExtendableEvent): Promise; /** * Handles the 'activate' service worker event. * @ignore * @param {import('../service-worker/events.js').ExtendableEvent} event */ - onActivate(event: import('../service-worker/events.js').ExtendableEvent): Promise; + onActivate(event: import("socket:service-worker/events").ExtendableEvent): Promise; /** * Handles the 'fetch' service worker event. * @ignore @@ -13467,7 +13473,7 @@ declare module "socket:test/index" { * @param {string} [msg] * @returns {void} */ - notDeepEqual(actual: T_1, expected: T_1, msg?: string): void; + notDeepEqual(actual: T, expected: T, msg?: string): void; /** * @template T * @param {T} actual @@ -13475,7 +13481,7 @@ declare module "socket:test/index" { * @param {string} [msg] * @returns {void} */ - equal(actual: T_2, expected: T_2, msg?: string): void; + equal(actual: T, expected: T, msg?: string): void; /** * @param {unknown} actual * @param {unknown} expected @@ -13724,7 +13730,7 @@ declare module "socket:test/index" { * }) * ``` */ - waitForText(selector: string | HTMLElement | Element, opts?: string | RegExp | { + waitForText(selector: string | HTMLElement | Element, opts?: { /** * - The text to wait for */ @@ -13735,7 +13741,7 @@ declare module "socket:test/index" { * The regex to wait for */ regex?: RegExp; - }, msg?: string): Promise; + } | string | RegExp, msg?: string): Promise; /** * Run a querySelector as an assert and also get the results * @@ -15016,7 +15022,7 @@ declare module "socket:commonjs/package" { * @param {PackageResolveOptions=} [options] * @return {string} */ - resolve(pathname: string | URL, options?: PackageResolveOptions): string; + resolve(pathname: string | URL, options?: PackageResolveOptions | undefined): string; #private; } export default Package; @@ -15027,13 +15033,13 @@ declare module "socket:commonjs/package" { version?: string; license?: string; exports?: object; - type?: 'commonjs' | 'module'; + type?: "commonjs" | "module"; info?: object; origin?: string; dependencies?: Dependencies | object | Map; }; export type PackageLoadOptions = import("socket:commonjs/loader").RequestOptions & { - type?: 'commonjs' | 'module'; + type?: "commonjs" | "module"; prefix?: string; }; export type ParsedPackageName = { @@ -15073,7 +15079,7 @@ declare module "socket:commonjs/module" { * @param {typeof process} process * @param {object} global */ - export function CommonJSModuleScope(exports: object, require: (arg0: string) => any, module: Module, __filename: string, __dirname: string, process: typeof process, global: object): void; + export function CommonJSModuleScope(exports: object, require: (arg0: string) => any, module: Module, __filename: string, __dirname: string, process: any, global: object): void; /** * Creates a `require` function from a given module URL. * @param {string|URL} url @@ -15433,7 +15439,7 @@ declare module "socket:commonjs/module" { * @throws TypeError * @return {any} */ - require(url: any, options?: RequireOptions): any; + require(url: any, options?: RequireOptions | undefined): any; /** * Loads the module * @param {ModuleLoadOptions=} [options] @@ -15471,9 +15477,9 @@ declare module "socket:commonjs/module" { export type ModuleLoadOptions = { extensions?: object; }; - import process from "socket:process"; import { Package } from "socket:commonjs/package"; import { Loader } from "socket:commonjs/loader"; + import process from "socket:process"; } declare module "socket:commonjs/require" { @@ -15532,7 +15538,7 @@ declare module "socket:commonjs/require" { * `Meta` class constructor. * @param {import('./module.js').Module} module */ - constructor(module: import('./module.js').Module); + constructor(module: import("socket:commonjs/module").Module); /** * The referrer (parent) of this module. * @type {string} @@ -16092,7 +16098,7 @@ declare module "socket:notification" { * @param {boolean=} [options.force = false] * @return {Promise<'granted'|'default'|'denied'>} */ - static requestPermission(options?: object | undefined): Promise<'granted' | 'default' | 'denied'>; + static requestPermission(options?: object | undefined): Promise<"granted" | "default" | "denied">; /** * `Notification` class constructor. * @param {string} title @@ -16278,9 +16284,9 @@ declare module "socket:service-worker/instance" { readonly state: any; readonly scriptURL: any; postMessage(): void; - addEventListener(type: string, callback: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, callback: EventListenerOrEventListenerObject | null, options?: AddEventListenerOptions | boolean): void; dispatchEvent(event: Event): boolean; - removeEventListener(type: string, callback: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, callback: EventListenerOrEventListenerObject | null, options?: EventListenerOptions | boolean): void; }; }; export default createServiceWorker; @@ -16996,7 +17002,7 @@ declare module "socket:internal/pickers" { * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/Window/showOpenFilePicker} * @return {Promise} */ - export function showOpenFilePicker(options?: ShowOpenFilePickerOptions): Promise; + export function showOpenFilePicker(options?: ShowOpenFilePickerOptions | undefined): Promise; /** * @typedef {{ * id?: string, @@ -17016,7 +17022,7 @@ declare module "socket:internal/pickers" { * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/Window/showSaveFilePicker} * @return {Promise} */ - export function showSaveFilePicker(options?: ShowSaveFilePickerOptions): Promise; + export function showSaveFilePicker(options?: ShowSaveFilePickerOptions | undefined): Promise; /** * Key-value store for general usage by the file pickers" * @ignore @@ -17038,8 +17044,8 @@ declare module "socket:internal/pickers" { export default _default; export type ShowDirectoryPickerOptions = { id?: string; - mode?: 'read' | 'readwrite'; - startIn?: FileSystemHandle | 'desktop' | 'documents' | 'downloads' | 'music' | 'pictures' | 'videos'; + mode?: "read" | "readwrite"; + startIn?: FileSystemHandle | "desktop" | "documents" | "downloads" | "music" | "pictures" | "videos"; }; /** * ]?: string[] @@ -17049,10 +17055,10 @@ declare module "socket:internal/pickers" { export type object = { id?: string; excludeAcceptAllOption?: boolean; - startIn?: FileSystemHandle | 'desktop' | 'documents' | 'downloads' | 'music' | 'pictures' | 'videos'; + startIn?: FileSystemHandle | "desktop" | "documents" | "downloads" | "music" | "pictures" | "videos"; types?: Array<{ description?: string; - [keyof]; + [keyof]: any; }>; }; } @@ -17153,7 +17159,7 @@ declare module "socket:npm/module" { */ export function resolve(specifier: string | URL, origin?: (string | URL) | undefined, options?: { prefix?: string; - type?: 'commonjs' | 'module'; + type?: "commonjs" | "module"; }): ModuleResolution | null; namespace _default { export { resolve }; @@ -17162,7 +17168,7 @@ declare module "socket:npm/module" { export type ModuleResolution = { package: Package; origin: string; - type: 'commonjs' | 'module'; + type: "commonjs" | "module"; url: string; }; import { Package } from "socket:commonjs/package"; @@ -17243,8 +17249,8 @@ declare module "socket:service-worker/init" { } declare function isTypedArray(object: any): boolean; declare function isTypedArray(object: any): boolean; -declare function isArrayBuffer(object: any): boolean; -declare function isArrayBuffer(object: any): boolean; +declare function isArrayBuffer(object: any): object is ArrayBuffer; +declare function isArrayBuffer(object: any): object is ArrayBuffer; declare function findMessageTransfers(transfers: any, object: any, options?: any): any; declare function findMessageTransfers(transfers: any, object: any, options?: any): any; declare const Uint8ArrayPrototype: Uint8Array; @@ -17258,7 +17264,7 @@ declare module "socket:service-worker/storage" { * @param {'memoryStorage'|'localStorage'|'sessionStorage'} type * @return {Promise} */ - export function createStorageInterface(type: 'memoryStorage' | 'localStorage' | 'sessionStorage'): Promise; + export function createStorageInterface(type: "memoryStorage" | "localStorage" | "sessionStorage"): Promise; /** * @typedef {{ done: boolean, value: string | undefined }} IndexIteratorResult */ @@ -17707,12 +17713,12 @@ declare module "socket:test/harness" { * @param {new (options: object) => T} harnessClass * @returns {TapeTestFn} */ - export function wrapHarness(tapzero: typeof import("socket:test/index"), harnessClass: new (options: object) => T): exports.TapeTestFn; + export function wrapHarness(tapzero: typeof import("socket:test/index"), harnessClass: new (options: object) => T): TapeTestFn; export default exports; /** * @template {Harness} T */ - export class TapeHarness { + export class TapeHarness { /** * @param {import('./index.js')} tapzero * @param {new (options: object) => T} harnessClass @@ -17765,7 +17771,7 @@ declare module "socket:test/harness" { bootstrap(): Promise; close(): Promise; }; - export type TapeTestFn = { + export type TapeTestFn = { (name: string, cb?: (harness: T, test: Test) => (void | Promise)): void; (name: string, opts: object, cb: (harness: T, test: Test) => (void | Promise)): void; only(name: string, cb?: (harness: T, test: Test) => (void | Promise)): void; @@ -17782,8 +17788,8 @@ declare module "socket:vm/init" { } declare function isTypedArray(object: any): boolean; declare function isTypedArray(object: any): boolean; -declare function isArrayBuffer(object: any): boolean; -declare function isArrayBuffer(object: any): boolean; +declare function isArrayBuffer(object: any): object is ArrayBuffer; +declare function isArrayBuffer(object: any): object is ArrayBuffer; declare function findMessageTransfers(transfers: any, object: any, options?: any): any; declare function findMessageTransfers(transfers: any, object: any, options?: any): any; declare const Uint8ArrayPrototype: Uint8Array;