An open API service indexing awesome lists of open source software.

https://github.com/delight-rpc/native-websocket

🌿
https://github.com/delight-rpc/native-websocket

browser esm library npm-package typescript

Last synced: 20 days ago
JSON representation

🌿

Awesome Lists containing this project

README

          

# @delight-rpc/native-websocket
## Install
```sh
npm install --save @delight-rpc/native-websocket
# or
yarn add @delight-rpc/native-websocket
```

## API
### createClient
```ts
function createClient(
socket: WebSocket
, options?: {
parameterValidators?: DelightRPC.ParameterValidators
expectedVersion?: string
channel?: string
timeout?: number
}
): [client: DelightRPC.ClientProxy, close: () => void]
```

### createBatchClient
```ts
function createBatchClient(
socket: WebSocket
, options?: {
expectedVersion?: string
channel?: string
timeout?: number
}
): [client: DelightRPC.BatchClient, close: () => void]
```

### createServer
```ts
function createServer(
api: DelightRPC.ImplementationOf
, socket: WebSocket
, options?: {
parameterValidators?: DelightRPC.ParameterValidators
version?: `${number}.${number}.${number}`
channel?: string | RegExp | AnyChannel
ownPropsOnly?: boolean
}
): () => void
```