From 0bacf08cc583a88c426bf4ebb17fa65dafda0fad Mon Sep 17 00:00:00 2001 From: Joseph Werle Date: Tue, 23 Jul 2024 16:43:08 +0200 Subject: [PATCH] chore(api): generate types + docs --- api/README.md | 16 +-- api/index.d.ts | 279 +++++++++++++++++++++++++------------------------ 2 files changed, 149 insertions(+), 146 deletions(-) diff --git a/api/README.md b/api/README.md index e9b80473d..6d5b52c04 100644 --- a/api/README.md +++ b/api/README.md @@ -1715,12 +1715,12 @@ Watch for changes at `path` calling `callback` 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#L1022) +## [`IPCSearchParams` (extends `URLSearchParams`)](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/ipc.js#L1026) 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#L1183) +## [`emit(name, value, target, options)`](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/ipc.js#L1187) 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#L1242) +## [`send(command, value, options)`](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/ipc.js#L1246) 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#L1693) +## [`inflateIPCMessageTransfers()`](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/ipc.js#L1697) 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#L1725) +## [`findIPCMessageTransfers()`](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/ipc.js#L1729) 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#L1774) +## [ports](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/ipc.js#L1778) 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#L1776) +## [`IPCMessagePort` (extends `MessagePort`)](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/ipc.js#L1780) 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#L1981) +## [`IPCMessageChannel` (extends `MessageChannel`)](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/ipc.js#L1985) 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 697ebc4bd..cec8d6b41 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; @@ -887,7 +887,7 @@ declare module "socket:ipc" { /** * @ignore */ - static from(input: any): any; + static from(input: any): Headers; /** * @ignore */ @@ -1397,7 +1397,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; @@ -2161,7 +2161,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; @@ -2837,7 +2837,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?} @@ -3072,7 +3072,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} @@ -3102,7 +3102,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} @@ -3246,7 +3246,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; @@ -3627,7 +3627,7 @@ 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; } @@ -4533,9 +4533,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 { @@ -5263,7 +5263,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 @@ -6136,7 +6136,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?} @@ -6980,7 +6980,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'} @@ -7012,10 +7012,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"; }; } @@ -7089,7 +7089,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} @@ -7302,6 +7302,7 @@ declare module "socket:window/hotkey" { */ export const bindings: Bindings; export default bindings; + import { HotKeyEvent } from "socket:internal/events"; } declare module "socket:window" { @@ -8022,6 +8023,78 @@ declare module "socket:shared-worker/index" { import ipc from "socket:ipc"; } +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; + export { _catch as catch }; + let _finally: (onfinally?: () => void) => globalThis.Promise; + export { _finally as finally }; + } + export const NativePromiseAll: any; + export const NativePromiseAny: any; + /** + * @typedef {function(any): void} ResolveFunction + */ + /** + * @typedef {function(Error|string|null): void} RejectFunction + */ + /** + * @typedef {function(ResolveFunction, RejectFunction): void} ResolverFunction + */ + /** + * @typedef {{ + * promise: Promise, + * resolve: ResolveFunction, + * reject: RejectFunction + * }} PromiseResolvers + */ + export class Promise extends globalThis.Promise { + /** + * Creates a new `Promise` with resolver functions. + * @see {https://github.com/tc39/proposal-promise-with-resolvers} + * @return {PromiseResolvers} + */ + static withResolvers(): PromiseResolvers; + /** + * `Promise` class constructor. + * @ignore + * @param {ResolverFunction} resolver + */ + constructor(resolver: ResolverFunction); + [resourceSymbol]: { + "__#15@#type": any; + "__#15@#destroyed": boolean; + "__#15@#asyncId": number; + "__#15@#triggerAsyncId": any; + "__#15@#requireManualDestroy": boolean; + readonly type: string; + readonly destroyed: boolean; + asyncId(): number; + triggerAsyncId(): number; + emitDestroy(): CoreAsyncResource; + bind(fn: Function, thisArg?: object | undefined): Function; + runInAsyncScope(fn: Function, thisArg?: object | undefined, ...args?: any[]): any; + }; + } + export namespace Promise { + function all(iterable: any): any; + function any(iterable: any): any; + } + export default Promise; + export type ResolveFunction = (arg0: any) => void; + export type RejectFunction = (arg0: Error | string | null) => void; + export type ResolverFunction = (arg0: ResolveFunction, arg1: RejectFunction) => void; + export type PromiseResolvers = { + promise: Promise; + resolve: ResolveFunction; + reject: RejectFunction; + }; + const resourceSymbol: unique symbol; + import * as asyncHooks from "socket:internal/async/hooks"; +} + declare module "socket:internal/globals" { /** * Gets a runtime global value by name. @@ -8622,7 +8695,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} @@ -9831,7 +9904,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 @@ -9906,7 +9979,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; @@ -10402,7 +10475,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 @@ -10466,7 +10539,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; } /** @@ -10598,7 +10671,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. @@ -10639,7 +10712,7 @@ declare module "socket:service-worker/context" { * Gets the client for this event context. * @return {Promise} */ - client(): Promise; + client(): Promise; #private; } namespace _default { @@ -10826,7 +10899,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. @@ -10861,13 +10934,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 @@ -13558,7 +13631,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 @@ -13566,7 +13639,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 @@ -13815,7 +13888,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 */ @@ -13826,7 +13899,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 * @@ -14767,6 +14840,7 @@ declare module "socket:commonjs/loader" { text?: string; }; import { Headers } from "socket:ipc"; + import URL from "socket:url"; import { Cache } from "socket:commonjs/cache"; } @@ -15106,7 +15180,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; @@ -15117,13 +15191,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 = { @@ -15147,6 +15221,7 @@ declare module "socket:commonjs/package" { worker?: string | string[]; browser?: string | string[]; }; + import URL from "socket:url"; import { Loader } from "socket:commonjs/loader"; } @@ -15206,7 +15281,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} @@ -15250,7 +15325,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 @@ -15610,7 +15685,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] @@ -15648,9 +15723,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:module" { @@ -15990,7 +16065,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 @@ -16176,9 +16251,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; @@ -16842,78 +16917,6 @@ declare module "socket:internal/scheduler" { import scheduler from "socket:timers/scheduler"; } -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; - export { _catch as catch }; - let _finally: (onfinally?: () => void) => globalThis.Promise; - export { _finally as finally }; - } - export const NativePromiseAll: any; - export const NativePromiseAny: any; - /** - * @typedef {function(any): void} ResolveFunction - */ - /** - * @typedef {function(Error|string|null): void} RejectFunction - */ - /** - * @typedef {function(ResolveFunction, RejectFunction): void} ResolverFunction - */ - /** - * @typedef {{ - * promise: Promise, - * resolve: ResolveFunction, - * reject: RejectFunction - * }} PromiseResolvers - */ - export class Promise extends globalThis.Promise { - /** - * Creates a new `Promise` with resolver functions. - * @see {https://github.com/tc39/proposal-promise-with-resolvers} - * @return {PromiseResolvers} - */ - static withResolvers(): PromiseResolvers; - /** - * `Promise` class constructor. - * @ignore - * @param {ResolverFunction} resolver - */ - constructor(resolver: ResolverFunction); - [resourceSymbol]: { - "__#15@#type": any; - "__#15@#destroyed": boolean; - "__#15@#asyncId": number; - "__#15@#triggerAsyncId": any; - "__#15@#requireManualDestroy": boolean; - readonly type: string; - readonly destroyed: boolean; - asyncId(): number; - triggerAsyncId(): number; - emitDestroy(): asyncHooks.CoreAsyncResource; - bind(fn: Function, thisArg?: any): Function; - runInAsyncScope(fn: Function, thisArg?: any, ...args?: any[]): any; - }; - } - export namespace Promise { - function all(iterable: any): any; - function any(iterable: any): any; - } - export default Promise; - export type ResolveFunction = (arg0: any) => void; - export type RejectFunction = (arg0: Error | string | null) => void; - export type ResolverFunction = (arg0: ResolveFunction, arg1: RejectFunction) => void; - export type PromiseResolvers = { - promise: Promise; - resolve: ResolveFunction; - reject: RejectFunction; - }; - const resourceSymbol: unique symbol; - import * as asyncHooks from "socket:internal/async/hooks"; -} - declare module "socket:internal/timers" { export function setTimeout(callback: any, ...args: any[]): number; export function clearTimeout(timeout: any): any; @@ -16966,7 +16969,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, @@ -16986,7 +16989,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 @@ -17008,8 +17011,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[] @@ -17019,10 +17022,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; }>; }; } @@ -17123,7 +17126,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 }; @@ -17132,7 +17135,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"; @@ -17213,8 +17216,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; @@ -17228,7 +17231,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 */ @@ -17677,12 +17680,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 @@ -17735,7 +17738,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; @@ -17752,8 +17755,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;