npm.io
0.6.6 • Published 6 months ago

@delight-rpc/extra-native-websocket

Licence
MIT
Version
0.6.6
Deps
9
Size
19 kB
Vulns
0
Weekly
0
Install scriptsThis package runs scripts during installation (preinstall/install/postinstall)

@delight-rpc/extra-native-websocket

Install

npm install --save @delight-rpc/extra-native-websocket
# or
yarn add @delight-rpc/extra-native-websocket

API

createClient
function createClient<IAPI extends object>(
  socket: ExtraNativeWebSocket
, options?: {
    parameterValidators?: DelightRPC.ParameterValidators<IAPI>
    expectedVersion?: string
    channel?: string
    timeout?: number
  }
): [client: DelightRPC.ClientProxy<IAPI>, close: () => void]
createBatchClient
function createBatchClient(
  socket: ExtraNativeWebSocket
, options?: {
    expectedVersion?: string
    channel?: string
    timeout?: number
  }
): [client: DelightRPC.BatchClient, close: () => void]
createServer
function createServer<IAPI extends object>(
  api: DelightRPC.ImplementationOf<IAPI>
, socket: ExtraNativeWebSocket
, options?: {
    parameterValidators?: DelightRPC.ParameterValidators<IAPI>
    version?: `${number}.${number}.${number}`
    channel?: string | RegExp | AnyChannel
    ownPropsOnly?: boolean
  }
): () => void