0.3.0 • Published 5 months ago

@delight-rpc/webextension v0.3.0

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

@delight-rpc/webextension

Install

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

API

createBackgroundClient

function createBackgroundClient<IAPI extends object>(
  options?: {
    parameterValidators?: DelightRPC.ParameterValidators<IAPI>
    expectedVersion?: string
    channel?: string
  }
): DelightRPC.ClientProxy<IAPI>

createTabClient

function createTabClient<IAPI extends object>(
  target: {
    tabId: number
    frameId?: number
  }
, options?: {
    parameterValidators?: DelightRPC.ParameterValidators<IAPI>
    expectedVersion?: string
    channel?: string
  }
): DelightRPC.ClientProxy<IAPI>

createBackgroundBatchClient

function createBackgroundBatchClient<DataType>(
  options?: {
    expectedVersion?: string
    channel?: string
  }
): DelightRPC.BatchClient<DataType>

createTabBatchClient

function createTabBatchClient<DataType>(
  target: {
    tabId: number
    frameId?: number
  }
, options?: {
    expectedVersion?: string
    channel?: string
  }
): DelightRPC.BatchClient<DataType>

createServer

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

5 months ago

0.2.1

11 months ago

0.2.0

1 year ago

0.1.1

1 year ago

0.1.0

1 year ago