shared/ipc/contract
Interfaces
Section titled “Interfaces”EventContract
Section titled “EventContract”Defined in: app/src/shared/ipc/contract.ts:24
A one-way event channel from the browser process to renderers.
Type Parameters
Section titled “Type Parameters”T
Properties
Section titled “Properties”capability
Section titled “capability”
readonlycapability:Capability
Defined in: app/src/shared/ipc/contract.ts:28
channel
Section titled “channel”
readonlychannel:string
Defined in: app/src/shared/ipc/contract.ts:26
readonlykind:"event"
Defined in: app/src/shared/ipc/contract.ts:25
payload
Section titled “payload”
readonlypayload:GenericSchema<unknown,T>
Defined in: app/src/shared/ipc/contract.ts:27
RequestContract
Section titled “RequestContract”Defined in: app/src/shared/ipc/contract.ts:12
A request-response channel between a renderer and the browser process.
Type Parameters
Section titled “Type Parameters”Req
Res
Properties
Section titled “Properties”capability
Section titled “capability”
readonlycapability:Capability
Defined in: app/src/shared/ipc/contract.ts:18
channel
Section titled “channel”
readonlychannel:string
Defined in: app/src/shared/ipc/contract.ts:15
Dotted channel name, such as tabs.activate.
readonlykind:"request"
Defined in: app/src/shared/ipc/contract.ts:13
ratePerSecond?
Section titled “ratePerSecond?”
readonlyoptionalratePerSecond?:number
Defined in: app/src/shared/ipc/contract.ts:20
Maximum calls per second and sender. Defaults to 50.
request
Section titled “request”
readonlyrequest:GenericSchema<unknown,Req>
Defined in: app/src/shared/ipc/contract.ts:16
response
Section titled “response”
readonlyresponse:GenericSchema<unknown,Res>
Defined in: app/src/shared/ipc/contract.ts:17
Type Aliases
Section titled “Type Aliases”Capability
Section titled “Capability”Capability =
"shell"|"overlay"|"appearance"|`page:${string}`
Defined in: app/src/shared/ipc/contract.ts:9
What a view is allowed to call or receive. Each view type gets only the capabilities it
needs: the shell gets shell, the overlay overlay, and internal pages page:<name>,
such as page:settings. Every view of the browser’s own UI gets appearance, the
events that restyle it.
Contract
Section titled “Contract”Contract =
RequestContract<unknown,unknown> |EventContract<unknown>
Defined in: app/src/shared/ipc/contract.ts:32
Any contract.
PayloadOf
Section titled “PayloadOf”PayloadOf<
C> =CextendsEventContract<infer T> ?T:never
Defined in: app/src/shared/ipc/contract.ts:39
Payload type of an event contract.
Type Parameters
Section titled “Type Parameters”C
RequestOf
Section titled “RequestOf”RequestOf<
C> =CextendsRequestContract<infer Req,unknown> ?Req:never
Defined in: app/src/shared/ipc/contract.ts:35
Request type of a request contract.
Type Parameters
Section titled “Type Parameters”C
ResponseOf
Section titled “ResponseOf”ResponseOf<
C> =CextendsRequestContract<unknown, infer Res> ?Res:never
Defined in: app/src/shared/ipc/contract.ts:37
Response type of a request contract.
Type Parameters
Section titled “Type Parameters”C
Functions
Section titled “Functions”defineEvent()
Section titled “defineEvent()”defineEvent<
T>(contract):EventContract<T>
Defined in: app/src/shared/ipc/contract.ts:64
Declares an event channel.
Type Parameters
Section titled “Type Parameters”T
Parameters
Section titled “Parameters”contract
Section titled “contract”Omit<EventContract<T>, "kind">
Channel, payload schema and capability.
Returns
Section titled “Returns”defineRequest()
Section titled “defineRequest()”defineRequest<
Req,Res>(contract):RequestContract<Req,Res>
Defined in: app/src/shared/ipc/contract.ts:53
Declares a request-response channel.
Type Parameters
Section titled “Type Parameters”Req
Res
Parameters
Section titled “Parameters”contract
Section titled “contract”Omit<RequestContract<Req, Res>, "kind">
Channel, schemas and capability.
Returns
Section titled “Returns”RequestContract<Req, Res>