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 19, 2024
1 parent 4aaf1db commit 157db56
Show file tree
Hide file tree
Showing 2 changed files with 181 additions and 175 deletions.
58 changes: 29 additions & 29 deletions api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
Expand All @@ -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
Expand All @@ -559,15 +559,15 @@ 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
its remote address. Trying to call disconnect() on an unbound or already
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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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.
Expand Down Expand Up @@ -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.

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

Expand All @@ -1747,27 +1747,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#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.
Expand Down
Loading

0 comments on commit 157db56

Please sign in to comment.