diff --git a/api/README.md b/api/README.md index aecf253bb2..97c421e502 100644 --- a/api/README.md +++ b/api/README.md @@ -1710,17 +1710,33 @@ 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#L280) +## [`maybeMakeError()`](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/ipc.js#L281) 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#L1036) +### [debug](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/ipc.js#L408) + + + +### [undefined](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/ipc.js#L408) + + + +### [undefined](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/ipc.js#L408) + + + +### [undefined](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/ipc.js#L408) + + + +## [`IPCSearchParams` (extends `URLSearchParams`)](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/ipc.js#L1050) 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#L1202) +## [`emit(name, value, target, options)`](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/ipc.js#L1218) Emit event to be dispatched on `window` object. @@ -1731,7 +1747,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#L1261) +## [`send(command, value, options)`](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/ipc.js#L1277) Sends an async IPC command request with parameters. @@ -1747,27 +1763,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#L1712) +## [`inflateIPCMessageTransfers()`](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/ipc.js#L1728) 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#L1744) +## [`findIPCMessageTransfers()`](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/ipc.js#L1760) 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#L1793) +## [ports](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/ipc.js#L1825) 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#L1795) +## [`IPCMessagePort` (extends `MessagePort`)](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/ipc.js#L1827) 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#L2000) +## [`IPCMessageChannel` (extends `MessageChannel`)](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/ipc.js#L2053) 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 5bcf959953..0478c420cb 100644 --- a/api/index.d.ts +++ b/api/index.d.ts @@ -800,7 +800,7 @@ declare module "socket:ipc" { */ export function debug(enable?: (boolean)): boolean; export namespace debug { - let enabled: any; + let enabled: boolean; function log(...args: any[]): any; } /** @@ -1038,11 +1038,11 @@ declare module "socket:ipc" { /** * Get a parameter value by `key`. * @param {string} key - * @param {any} defaultValue + * @param {any=} [defaultValue] * @return {any} * @ignore */ - get(key: string, defaultValue: any): any; + get(key: string, defaultValue?: any | undefined): any; /** * Delete a parameter by `key`. * @param {string} key @@ -1160,7 +1160,7 @@ declare module "socket:ipc" { [Symbol.iterator](): Generator; } export class IPCSearchParams extends URLSearchParams { - constructor(params: any, nonce: any); + constructor(params: any, nonce?: any); } /** * @ignore @@ -1177,6 +1177,7 @@ declare module "socket:ipc" { get onmessage(): any; set onmessageerror(onmessageerror: any); get onmessageerror(): any; + close(purge?: boolean): void; postMessage(message: any, optionsOrTransferList: any): void; addEventListener(...args: any[]): any; removeEventListener(...args: any[]): any; @@ -1184,9 +1185,10 @@ declare module "socket:ipc" { } export class IPCMessageChannel extends MessageChannel { constructor(options?: any); - port1: any; - port2: any; get id(): any; + get port1(): any; + get port2(): any; + get channel(): any; #private; } export default exports; @@ -8298,20 +8300,20 @@ declare module "socket:vm" { * garbage collected or there are no longer any references to it and its * associated `Script` instance. * @param {string|object|function} source - * @param {ScriptOptions=} [options] * @param {object=} [context] + * @param {ScriptOptions=} [options] * @return {Promise} */ - export function runInContext(source: string | object | Function, options?: ScriptOptions | undefined, context?: object | undefined): Promise; + export function runInContext(source: string | object | Function, context?: object | undefined, options?: ScriptOptions | undefined): Promise; /** * Run `source` JavaScript in new context. The script context is destroyed after * execution. This is typically a "one off" isolated run. * @param {string} source - * @param {ScriptOptions=} [options] * @param {object=} [context] + * @param {ScriptOptions=} [options] * @return {Promise} */ - export function runInNewContext(source: string, options?: ScriptOptions | undefined, context?: object | undefined): Promise; + export function runInNewContext(source: string, context?: object | undefined, options?: ScriptOptions | undefined): Promise; /** * Run `source` JavaScript in this current context (`globalThis`). * @param {string} source @@ -17664,6 +17666,7 @@ declare module "socket:shared-worker/worker" { export namespace module { let exports: {}; } + export const connections: Set; } declare module "socket:test/harness" {