Skip to content

Commit d442799

Browse files
committed
chore(api): generate types + docs
1 parent f03c470 commit d442799

File tree

2 files changed

+38
-19
lines changed

2 files changed

+38
-19
lines changed

api/README.md

+25-9
Original file line numberDiff line numberDiff line change
@@ -1710,17 +1710,33 @@ Watch for changes at `path` calling `callback`
17101710
import { send } from 'socket:ipc'
17111711
```
17121712

1713-
## [`maybeMakeError()`](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/ipc.js#L280)
1713+
## [`maybeMakeError()`](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/ipc.js#L281)
17141714

17151715
This is a `FunctionDeclaration` named `maybeMakeError` in `api/ipc.js`, it's exported but undocumented.
17161716
17171717
1718-
## [`IPCSearchParams` (extends `URLSearchParams`)](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/ipc.js#L1036)
1718+
### [debug](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/ipc.js#L408)
1719+
1720+
1721+
1722+
### [undefined](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/ipc.js#L408)
1723+
1724+
1725+
1726+
### [undefined](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/ipc.js#L408)
1727+
1728+
1729+
1730+
### [undefined](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/ipc.js#L408)
1731+
1732+
1733+
1734+
## [`IPCSearchParams` (extends `URLSearchParams`)](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/ipc.js#L1050)
17191735
17201736
This is a `ClassDeclaration` named ``IPCSearchParams` (extends `URLSearchParams`)` in `api/ipc.js`, it's exported but undocumented.
17211737

17221738

1723-
## [`emit(name, value, target, options)`](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/ipc.js#L1202)
1739+
## [`emit(name, value, target, options)`](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/ipc.js#L1218)
17241740

17251741
Emit event to be dispatched on `window` object.
17261742

@@ -1731,7 +1747,7 @@ Emit event to be dispatched on `window` object.
17311747
| target | EventTarget | window | true | |
17321748
| options | Object | | true | |
17331749

1734-
## [`send(command, value, options)`](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/ipc.js#L1261)
1750+
## [`send(command, value, options)`](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/ipc.js#L1277)
17351751

17361752
Sends an async IPC command request with parameters.
17371753

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

1750-
## [`inflateIPCMessageTransfers()`](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/ipc.js#L1712)
1766+
## [`inflateIPCMessageTransfers()`](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/ipc.js#L1728)
17511767

17521768
This is a `FunctionDeclaration` named `inflateIPCMessageTransfers` in `api/ipc.js`, it's exported but undocumented.
17531769
17541770
1755-
## [`findIPCMessageTransfers()`](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/ipc.js#L1744)
1771+
## [`findIPCMessageTransfers()`](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/ipc.js#L1760)
17561772
17571773
This is a `FunctionDeclaration` named `findIPCMessageTransfers` in `api/ipc.js`, it's exported but undocumented.
17581774

17591775

1760-
## [ports](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/ipc.js#L1793)
1776+
## [ports](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/ipc.js#L1825)
17611777

17621778
This is a `VariableDeclaration` named `ports` in `api/ipc.js`, it's exported but undocumented.
17631779
17641780
1765-
## [`IPCMessagePort` (extends `MessagePort`)](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/ipc.js#L1795)
1781+
## [`IPCMessagePort` (extends `MessagePort`)](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/ipc.js#L1827)
17661782
17671783
This is a `ClassDeclaration` named ``IPCMessagePort` (extends `MessagePort`)` in `api/ipc.js`, it's exported but undocumented.
17681784

17691785

1770-
## [`IPCMessageChannel` (extends `MessageChannel`)](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/ipc.js#L2000)
1786+
## [`IPCMessageChannel` (extends `MessageChannel`)](https://github.com/socketsupply/socket/blob/v0.6.0-next/api/ipc.js#L2053)
17711787

17721788
This is a `ClassDeclaration` named ``IPCMessageChannel` (extends `MessageChannel`)` in `api/ipc.js`, it's exported but undocumented.
17731789

api/index.d.ts

+13-10
Original file line numberDiff line numberDiff line change
@@ -800,7 +800,7 @@ declare module "socket:ipc" {
800800
*/
801801
export function debug(enable?: (boolean)): boolean;
802802
export namespace debug {
803-
let enabled: any;
803+
let enabled: boolean;
804804
function log(...args: any[]): any;
805805
}
806806
/**
@@ -1038,11 +1038,11 @@ declare module "socket:ipc" {
10381038
/**
10391039
* Get a parameter value by `key`.
10401040
* @param {string} key
1041-
* @param {any} defaultValue
1041+
* @param {any=} [defaultValue]
10421042
* @return {any}
10431043
* @ignore
10441044
*/
1045-
get(key: string, defaultValue: any): any;
1045+
get(key: string, defaultValue?: any | undefined): any;
10461046
/**
10471047
* Delete a parameter by `key`.
10481048
* @param {string} key
@@ -1160,7 +1160,7 @@ declare module "socket:ipc" {
11601160
[Symbol.iterator](): Generator<any, void, unknown>;
11611161
}
11621162
export class IPCSearchParams extends URLSearchParams {
1163-
constructor(params: any, nonce: any);
1163+
constructor(params: any, nonce?: any);
11641164
}
11651165
/**
11661166
* @ignore
@@ -1177,16 +1177,18 @@ declare module "socket:ipc" {
11771177
get onmessage(): any;
11781178
set onmessageerror(onmessageerror: any);
11791179
get onmessageerror(): any;
1180+
close(purge?: boolean): void;
11801181
postMessage(message: any, optionsOrTransferList: any): void;
11811182
addEventListener(...args: any[]): any;
11821183
removeEventListener(...args: any[]): any;
11831184
dispatchEvent(event: any): any;
11841185
}
11851186
export class IPCMessageChannel extends MessageChannel {
11861187
constructor(options?: any);
1187-
port1: any;
1188-
port2: any;
11891188
get id(): any;
1189+
get port1(): any;
1190+
get port2(): any;
1191+
get channel(): any;
11901192
#private;
11911193
}
11921194
export default exports;
@@ -8298,20 +8300,20 @@ declare module "socket:vm" {
82988300
* garbage collected or there are no longer any references to it and its
82998301
* associated `Script` instance.
83008302
* @param {string|object|function} source
8301-
* @param {ScriptOptions=} [options]
83028303
* @param {object=} [context]
8304+
* @param {ScriptOptions=} [options]
83038305
* @return {Promise<any>}
83048306
*/
8305-
export function runInContext(source: string | object | Function, options?: ScriptOptions | undefined, context?: object | undefined): Promise<any>;
8307+
export function runInContext(source: string | object | Function, context?: object | undefined, options?: ScriptOptions | undefined): Promise<any>;
83068308
/**
83078309
* Run `source` JavaScript in new context. The script context is destroyed after
83088310
* execution. This is typically a "one off" isolated run.
83098311
* @param {string} source
8310-
* @param {ScriptOptions=} [options]
83118312
* @param {object=} [context]
8313+
* @param {ScriptOptions=} [options]
83128314
* @return {Promise<any>}
83138315
*/
8314-
export function runInNewContext(source: string, options?: ScriptOptions | undefined, context?: object | undefined): Promise<any>;
8316+
export function runInNewContext(source: string, context?: object | undefined, options?: ScriptOptions | undefined): Promise<any>;
83158317
/**
83168318
* Run `source` JavaScript in this current context (`globalThis`).
83178319
* @param {string} source
@@ -17664,6 +17666,7 @@ declare module "socket:shared-worker/worker" {
1766417666
export namespace module {
1766517667
let exports: {};
1766617668
}
17669+
export const connections: Set<any>;
1766717670
}
1766817671

1766917672
declare module "socket:test/harness" {

0 commit comments

Comments
 (0)