ui/shell/bridge
Classes
Section titled “Classes”ShellBridge
Section titled “ShellBridge”Defined in: app/src/ui/shell/bridge.ts:63
Typed access to the browser process from the shell.
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new ShellBridge(
raw):ShellBridge
Defined in: app/src/ui/shell/bridge.ts:67
Parameters
Section titled “Parameters”PreloadBridge
The preload bridge, window.bridge.
Returns
Section titled “Returns”Methods
Section titled “Methods”invoke()
Section titled “invoke()”invoke<
K>(channel,request):Promise<ResponseOf<Requests[K]>>
Defined in: app/src/ui/shell/bridge.ts:76
Calls a request channel.
Type Parameters
Section titled “Type Parameters”K extends keyof Requests
Parameters
Section titled “Parameters”channel
Section titled “channel”K
The channel.
request
Section titled “request”RequestOf<Requests[K]>
The request; the browser process validates it again.
Returns
Section titled “Returns”Promise<ResponseOf<Requests[K]>>
on<
K>(channel,listener): () =>void
Defined in: app/src/ui/shell/bridge.ts:90
Listens to an event channel.
Type Parameters
Section titled “Type Parameters”K extends keyof Events
Parameters
Section titled “Parameters”channel
Section titled “channel”K
The channel.
listener
Section titled “listener”(payload) => void
Receives each payload.
Returns
Section titled “Returns”A function that removes the listener.
() => void