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
🌿
- Host: GitHub
- URL: https://github.com/delight-rpc/webextension
- Owner: delight-rpc
- License: mit
- Created: 2023-02-11T13:33:55.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2023-06-11T07:01:28.000Z (about 3 years ago)
- Last Synced: 2023-12-03T06:21:13.426Z (over 2 years ago)
- Topics: browser, esm, library, npm-package, typescript
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/@delight-rpc/webextension
- Size: 145 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
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
```