Skip to content

Commit

Permalink
chore(api): generate types + docs
Browse files Browse the repository at this point in the history
  • Loading branch information
jwerle committed Aug 20, 2024
1 parent f03c470 commit d442799
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 19 deletions.
34 changes: 25 additions & 9 deletions api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand All @@ -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.

Expand All @@ -1747,27 +1763,27 @@ Sends an async IPC command request with parameters.
| :--- | :--- | :--- |
| Not specified | Promise<Result> | |

## [`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.
Expand Down
23 changes: 13 additions & 10 deletions api/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
/**
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -1160,7 +1160,7 @@ declare module "socket:ipc" {
[Symbol.iterator](): Generator<any, void, unknown>;
}
export class IPCSearchParams extends URLSearchParams {
constructor(params: any, nonce: any);
constructor(params: any, nonce?: any);
}
/**
* @ignore
Expand All @@ -1177,16 +1177,18 @@ 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;
dispatchEvent(event: any): any;
}
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;
Expand Down Expand Up @@ -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<any>}
*/
export function runInContext(source: string | object | Function, options?: ScriptOptions | undefined, context?: object | undefined): Promise<any>;
export function runInContext(source: string | object | Function, context?: object | undefined, options?: ScriptOptions | undefined): Promise<any>;
/**
* 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<any>}
*/
export function runInNewContext(source: string, options?: ScriptOptions | undefined, context?: object | undefined): Promise<any>;
export function runInNewContext(source: string, context?: object | undefined, options?: ScriptOptions | undefined): Promise<any>;
/**
* Run `source` JavaScript in this current context (`globalThis`).
* @param {string} source
Expand Down Expand Up @@ -17664,6 +17666,7 @@ declare module "socket:shared-worker/worker" {
export namespace module {
let exports: {};
}
export const connections: Set<any>;
}

declare module "socket:test/harness" {
Expand Down

0 comments on commit d442799

Please sign in to comment.