0.7.0 • Published 5 months ago

@delight-rpc/extra-websocket v0.7.0

Weekly downloads
-
License
MIT
Repository
github
Last release
5 months ago

@delight-rpc/extra-websocket

Install

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

API

createClient

function createClient<IAPI extends object>(
  socket: ExtraWebSocket
, options?: {
    parameterValidators?: DelightRPC.ParameterValidators<IAPI>
    expectedVersion?: string
    channel?: string
    timeout?: number
  }
): [client: DelightRPC.ClientProxy<IAPI>, close: () => void]

createBatchClient

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

createServer

function createServer<IAPI extends object>(
  api: DelightRPC.ImplementationOf<IAPI>
, socket: ExtraWebSocket
, options?: {
    loggerLevel?: Level = Level.None
    parameterValidators?: DelightRPC.ParameterValidators<IAPI>
    version?: `${number}.${number}.${number}`
    channel?: string | RegExp | AnyChannel
    ownPropsOnly?: boolean
  }
): () => void