Seed Bible extension API (v1.18.0) / seed-bible/extensions / createSandboxClient
Function: createSandboxClient()
function createSandboxClient(
port: MessagePort,
init: SandboxInit,
): {
call: <M>(
method: M,
params: SandboxMethods[M]["params"],
) => Promise<SandboxMethods[M]["result"]>;
sb: SandboxContext;
};Connects to the host over port and builds the sb object an extension uses. Exported for tests, which drive a frame without an iframe.
Parameters
| Parameter | Type |
|---|---|
port | MessagePort |
init | SandboxInit |
Returns
{
call: <M,>(method: M, params: SandboxMethods[M]["params"]) =>
Promise<SandboxMethods[M]["result"]>;
sb: SandboxContext;
}call
call: <M>(
method: M,
params: SandboxMethods[M]["params"],
) => Promise<SandboxMethods[M]["result"]>;Type Parameters
| Type Parameter |
|---|
M extends keyof SandboxMethods |
Parameters
| Parameter | Type |
|---|---|
method | M |
params | SandboxMethods[M]["params"] |
Returns
Promise<SandboxMethods[M]["result"]>
sb
sb: SandboxContext;