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

https://github.com/delight-rpc/webextension

🌿
https://github.com/delight-rpc/webextension

browser esm library npm-package typescript

Last synced: 3 months ago
JSON representation

🌿

Awesome Lists containing this project

README

          

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

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

### createTabClient
```ts
function createTabClient(
target: {
tabId: number
frameId?: number
}
, options?: {
parameterValidators?: DelightRPC.ParameterValidators
expectedVersion?: string
channel?: string
timeout?: number
}
): [client: DelightRPC.ClientProxy, close: () => void]
```

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

### createTabBatchClient
```ts
function createTabBatchClient(
target: {
tabId: number
frameId?: number
}
, options?: {
expectedVersion?: string
channel?: string
timeout?: number
}
): [client: DelightRPC.BatchClient, close: () => void]
```

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