@fkn/lib/contract
Type Aliases
Section titled “Type Aliases”Account
Section titled “Account”type Account = object;The signed-in account, or null when nobody is.
Properties
Section titled “Properties”image: string | null;name: string;premium
Section titled “premium”premium: boolean;premiumUntil
Section titled “premiumUntil”premiumUntil: string | null;AddressLookupResult
Section titled “AddressLookupResult”type AddressLookupResult = object;Properties
Section titled “Properties”address
Section titled “address”address: string;family
Section titled “family”family: 0 | 4 | 6;AdoptRequest
Section titled “AdoptRequest”type AdoptRequest = object;Properties
Section titled “Properties”bytes: number;files: number;AdoptState
Section titled “AdoptState”type AdoptState = object;Properties
Section titled “Properties”bytes: number;files: number;ConflictChoice
Section titled “ConflictChoice”type ConflictChoice = "local" | "cloud" | null;ConflictRequest
Section titled “ConflictRequest”type ConflictRequest = object;Properties
Section titled “Properties”cloud: ConflictSide;local: ConflictSide;path: string;ConflictSide
Section titled “ConflictSide”type ConflictSide = object;Properties
Section titled “Properties”size: number;updatedAt
Section titled “updatedAt”updatedAt: string | null;ConnectAvailability
Section titled “ConnectAvailability”type ConnectAvailability = "connected" | "disconnected" | "unknown";Three answers where available() has two. disconnected is an ANSWER and unknown is nobody
having been asked; the library’s local-first queue drops its cloud obligation only on the first
and keeps the write queued on the second.
ConnectOptions
Section titled “ConnectOptions”type ConnectOptions = object;Properties
Section titled “Properties”protocol?
Section titled “protocol?”optional protocol?: string;opaque contract tag delivered to the package’s onConnect, e.g. ‘stub-source@1’
DisplayCause
Section titled “DisplayCause”type DisplayCause = "not-rendered" | "clipped" | "not-shown";DisplayLevel
Section titled “DisplayLevel”type DisplayLevel = "full" | "liveness";full means this engine reported a boolean isVisible; liveness means we only know it paints
DnsLookup
Section titled “DnsLookup”type DnsLookup = <T>(hostname, options?) => Promise<T extends true ? AddressLookupResult[] : AddressLookupResult | undefined>;Type Parameters
Section titled “Type Parameters”T extends boolean = false
Parameters
Section titled “Parameters”hostname
Section titled “hostname”string
options?
Section titled “options?”T
family?
Section titled “family?”0 | 4 | 6
Returns
Section titled “Returns”Promise<T extends true ? AddressLookupResult[] : AddressLookupResult | undefined>
EncryptionState
Section titled “EncryptionState”type EncryptionState = object;Encryption state of the account’s cloud storage.
Properties
Section titled “Properties”enrolled
Section titled “enrolled”enrolled: boolean;keyEpoch
Section titled “keyEpoch”keyEpoch: number | null;unlocked
Section titled “unlocked”unlocked: boolean;FrameConsentRequest
Section titled “FrameConsentRequest”type FrameConsentRequest = object;Properties
Section titled “Properties”hosts: string[];scope: FrameFetchScope;FrameFetchScope
Section titled “FrameFetchScope”type FrameFetchScope = "frame.fetchRead" | "frame.fetchWrite";HiddenSurface
Section titled “HiddenSurface”type HiddenSurface = object;Properties
Section titled “Properties”cause: DisplayCause;kind: string;level: DisplayLevel;InstalledPackage
Section titled “InstalledPackage”type InstalledPackage = object;Properties
Section titled “Properties”installedAt
Section titled “installedAt”installedAt: number;name: string;uri: string;version
Section titled “version”version: string | null;null when the handler addresses code directly and has no version to pin, e.g. a dev server
InstallOptions
Section titled “InstallOptions”type InstallOptions = object;Properties
Section titled “Properties”noConfirm?
Section titled “noConfirm?”optional noConfirm?: boolean;skip the confirm prompt and report the install with a notice instead; the record stays scoped to the calling app
version?
Section titled “version?”optional version?: string;exact version to pin; defaults to the packument’s latest dist-tag
IpFamily
Section titled “IpFamily”type IpFamily = "IPv4" | "IPv6";MountDescriptor
Section titled “MountDescriptor”type MountDescriptor = object;Everything an app needs to mount a package’s tenant in its OWN document.
Properties
Section titled “Properties”from: string;the connecting app, as the BROKER knows it
name: string;origin
Section titled “origin”origin: string;the tenant origin alone, which is what a postMessage to that frame must target
uri: string;the version-free identity, echoed to the package in the port message
url: string;where to point the iframe: the tenant origin plus the package’s path
version
Section titled “version”version: string | null;OverlayRect
Section titled “OverlayRect”type OverlayRect = object;Viewport rect plus optional corner radii, as the overlay host reports them.
Properties
Section titled “Properties”height
Section titled “height”height: number;radius?
Section titled “radius?”optional radius?: [number, number, number, number];width: number;x: number;y: number;OverlayState
Section titled “OverlayState”type OverlayState = object;What the host page pushes to the broker frame so its UI stays clickable through app chrome.
Properties
Section titled “Properties”hidden
Section titled “hidden”hidden: HiddenSurface[];inset: object;top: number;modal: boolean;rects: OverlayRect[];view: object;height
Section titled “height”height: number;width: number;PackageQuery
Section titled “PackageQuery”type PackageQuery = object;Properties
Section titled “Properties”optional id?: string;host app scope, e.g. ‘stub’ - becomes the keyword fkn-<type>--<id>
origin?
Section titled “origin?”optional origin?: "npm";package source; npm is the only origin implemented
optional size?: number;result count, clamped to 1..100
optional text?: string;free text mixed into the registry query
type: string;package kind, e.g. ‘plugin’ - becomes the keyword fkn-type:<type>
PackageResult
Section titled “PackageResult”type PackageResult = object;Properties
Section titled “Properties”description
Section titled “description”description: string;downloadsMonthly
Section titled “downloadsMonthly”downloadsMonthly: number | null;installed
Section titled “installed”installed: boolean;installed by the calling app
keywords
Section titled “keywords”keywords: string[];links: object;homepage?
Section titled “homepage?”optional homepage?: string;optional npm?: string;repository?
Section titled “repository?”optional repository?: string;name: string;origin
Section titled “origin”origin: "npm";publisher
Section titled “publisher”publisher: string | null;uri: string;normalized version-free uri, e.g. ‘npm:@banou/stub-plugin-foo’
version
Section titled “version”version: string;latest version per the search index - display only, install re-resolves from the packument
PackagesErrorCode
Section titled “PackagesErrorCode”type PackagesErrorCode = | "invalid" | "not-installed" | "unaddressable" | "timeout" | "unavailable" | "denied";PackagesFail
Section titled “PackagesFail”type PackagesFail = object;Properties
Section titled “Properties”error: PackagesErrorCode;message
Section titled “message”message: string;PickOptions
Section titled “PickOptions”type PickOptions = object;Properties
Section titled “Properties”multiple?
Section titled “multiple?”optional multiple?: boolean;title?
Section titled “title?”optional title?: string;untrusted, rendered as text in the picker header
Placement
Section titled “Placement”type Placement = object;Properties
Section titled “Properties”optional clip?: SurfaceRect;the part of rect still visible after the placeholder’s scroll ancestors clip it
radius?
Section titled “radius?”optional radius?: Radii;the placeholder’s corner radii, so the frame follows a rounded container
rect: SurfaceRect;where the package frame sits, so its own layout gets the full box
ProxyFetch
Section titled “ProxyFetch”type ProxyFetch = (input, init) => Promise<Response>;Parameters
Section titled “Parameters”Returns
Section titled “Returns”Promise<Response>
ProxyFetchInit
Section titled “ProxyFetchInit”type ProxyFetchInit = RequestInit & object | undefined;ProxyFetchInput
Section titled “ProxyFetchInput”type ProxyFetchInput = string | URL | Request;type Quota = object;Metered proxy usage for the account behind the broker.
Properties
Section titled “Properties”bytesPerSecond
Section titled “bytesPerSecond”bytesPerSecond: number;limitBytes
Section titled “limitBytes”limitBytes: number;overQuota
Section titled “overQuota”overQuota: boolean;premium
Section titled “premium”premium: boolean;remaining
Section titled “remaining”remaining: number;usedBytes
Section titled “usedBytes”usedBytes: number;type Radii = [number, number, number, number];corner radii in css order: top-left, top-right, bottom-right, bottom-left
Resolvers
Section titled “Resolvers”type Resolvers = object;Everything the broker exposes over osra.
The flat members at the bottom duplicate members of cloud and overlay. They predate the
namespaced form and are kept because a published consumer may still be calling them: they are
contract, not dead code.
Properties
Section titled “Properties”account
Section titled “account”account: object;info: () => Promise<Account | null>;Returns
Section titled “Returns”login: (consumerOrigin) => Promise<boolean>;Parameters
Section titled “Parameters”consumerOrigin
Section titled “consumerOrigin”string
Returns
Section titled “Returns”Promise<boolean>
logout
Section titled “logout”logout: () => void;Returns
Section titled “Returns”void
onChange
Section titled “onChange”onChange: (listener) => () => void;Parameters
Section titled “Parameters”listener
Section titled “listener”() => void
Returns
Section titled “Returns”() => void
cloud: object;dns: object;dns.lookup
Section titled “dns.lookup”lookup: DnsLookup;fetch: ProxyFetch;fs: object;fs.availability
Section titled “fs.availability”availability: () => Promise<ConnectAvailability>;Returns
Section titled “Returns”fs.available
Section titled “fs.available”available: () => Promise<boolean>;Returns
Section titled “Returns”Promise<boolean>
fs.encryption
Section titled “fs.encryption”encryption: () => Promise<EncryptionState>;Returns
Section titled “Returns”fs.list
Section titled “fs.list”list: () => Promise<StorageEntry[]>;Returns
Section titled “Returns”fs.promptAdopt
Section titled “fs.promptAdopt”promptAdopt: (request) => Promise<boolean>;Parameters
Section titled “Parameters”request
Section titled “request”Returns
Section titled “Returns”Promise<boolean>
fs.promptConflict
Section titled “fs.promptConflict”promptConflict: (request) => Promise<ConflictChoice>;Parameters
Section titled “Parameters”request
Section titled “request”Returns
Section titled “Returns”fs.quota
Section titled “fs.quota”quota: () => Promise<StorageQuota>;Returns
Section titled “Returns”fs.readFile
Section titled “fs.readFile”readFile: (path) => Promise<Uint8Array>;Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”Promise<Uint8Array>
fs.readFileSealed
Section titled “fs.readFileSealed”readFileSealed: (path) => Promise<{ bytes: Uint8Array; sealedAt: number | null;}>;The same read as readFile, plus the seal time the envelope authenticates, in milliseconds,
or null for an envelope that carries no such field.
Authenticated means the server can neither forge nor alter it, because it is covered by the envelope’s AAD; it is still the WRITER’s own claim about when it sealed, so on its own it does not prove that this copy is the newest one.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”Promise<{
bytes: Uint8Array;
sealedAt: number | null;
}>
fs.remove
Section titled “fs.remove”remove: (path) => Promise<void>;Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”Promise<void>
fs.setAdoptSource
Section titled “fs.setAdoptSource”setAdoptSource: (next, run) => void;Parameters
Section titled “Parameters”AdoptState | null
(() => Promise<void>) | null
Returns
Section titled “Returns”void
fs.unlock
Section titled “fs.unlock”unlock: () => Promise<boolean>;Returns
Section titled “Returns”Promise<boolean>
fs.writeFile
Section titled “fs.writeFile”writeFile: (path, data, contentType) => Promise<void>;Parameters
Section titled “Parameters”string
contentType
Section titled “contentType”string | null
Returns
Section titled “Returns”Promise<void>
quota: () => Promise<Quota>;Returns
Section titled “Returns”webvpn
Section titled “webvpn”webvpn: object;webvpn.tcpSocket
Section titled “webvpn.tcpSocket”tcpSocket: (options) => Promise<TcpSocketResult>;Parameters
Section titled “Parameters”options
Section titled “options”Returns
Section titled “Returns”webvpn.tcpSocketListener
Section titled “webvpn.tcpSocketListener”tcpSocketListener: (options) => Promise<TcpSocketListenerResult>;Parameters
Section titled “Parameters”options
Section titled “options”Returns
Section titled “Returns”Promise<TcpSocketListenerResult>
webvpn.udpSocket
Section titled “webvpn.udpSocket”udpSocket: (options) => Promise<UdpSocketResult>;Parameters
Section titled “Parameters”options
Section titled “options”Returns
Section titled “Returns”connect
Section titled “connect”connect: object;prompt
Section titled “prompt”prompt: (consumerOrigin) => Promise<boolean>;Parameters
Section titled “Parameters”consumerOrigin
Section titled “consumerOrigin”string
Returns
Section titled “Returns”Promise<boolean>
dnsLookup
Section titled “dnsLookup”dnsLookup: DnsLookup;frameConsent
Section titled “frameConsent”frameConsent: object;ensure
Section titled “ensure”ensure: (request) => Promise<boolean>;Parameters
Section titled “Parameters”request
Section titled “request”Returns
Section titled “Returns”Promise<boolean>
hideInstallPrompt
Section titled “hideInstallPrompt”hideInstallPrompt: () => void;Returns
Section titled “Returns”void
installPrompt
Section titled “installPrompt”installPrompt: object;hide: () => void;Returns
Section titled “Returns”void
show: (reason?) => Promise<void>;Parameters
Section titled “Parameters”reason?
Section titled “reason?”string
Returns
Section titled “Returns”Promise<void>
overlay
Section titled “overlay”overlay: object;setHost
Section titled “setHost”setHost: SetOverlayHost;packages
Section titled “packages”packages: object;connect
Section titled “connect”connect: (uri, options?) => Promise< | PackagesFail | { closed: Promise<void>; port: MessagePort;}>;Parameters
Section titled “Parameters”string
options?
Section titled “options?”Returns
Section titled “Returns”Promise<
| PackagesFail
| {
closed: Promise<void>;
port: MessagePort;
}>
frame: (uri) => Promise<PackagesFail | MountDescriptor>;Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”Promise<PackagesFail | MountDescriptor>
hide: (uri) => Promise< | PackagesFail | { ok: true;}>;Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”Promise<
| PackagesFail
| {
ok: true;
}>
install
Section titled “install”install: (uri, options?) => Promise< | PackagesFail | { installed: InstalledPackage;} | { declined: true;}>;Parameters
Section titled “Parameters”string
options?
Section titled “options?”Returns
Section titled “Returns”Promise<
| PackagesFail
| {
installed: InstalledPackage;
}
| {
declined: true;
}>
list: () => Promise<{ results: InstalledPackage[];}>;Returns
Section titled “Returns”Promise<{
results: InstalledPackage[];
}>
pick: (query, options?) => Promise< | PackagesFail | { failed: string[]; results: PackageResult[];} | { declined: true;}>;Parameters
Section titled “Parameters”options?
Section titled “options?”Returns
Section titled “Returns”Promise<
| PackagesFail
| {
failed: string[];
results: PackageResult[];
}
| {
declined: true;
}>
search
Section titled “search”search: (query) => Promise< | PackagesFail | { results: PackageResult[];}>;Parameters
Section titled “Parameters”Returns
Section titled “Returns”Promise<
| PackagesFail
| {
results: PackageResult[];
}>
show: (uri, placement) => Promise< | PackagesFail | { ok: true;}>;Parameters
Section titled “Parameters”string
placement
Section titled “placement”Returns
Section titled “Returns”Promise<
| PackagesFail
| {
ok: true;
}>
uninstall
Section titled “uninstall”uninstall: (uri) => Promise< | PackagesFail | { ok: true;}>;Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”Promise<
| PackagesFail
| {
ok: true;
}>
proxyFetch
Section titled “proxyFetch”proxyFetch: ProxyFetch;relay: object;prompt
Section titled “prompt”prompt: () => Promise<string>;Returns
Section titled “Returns”Promise<string>
rooms: object;available
Section titled “available”available: () => Promise<boolean>;Returns
Section titled “Returns”Promise<boolean>
create
Section titled “create”create: (options?) => Promise<RoomsFail | RoomHandle>;Parameters
Section titled “Parameters”options?
Section titled “options?”Returns
Section titled “Returns”Promise<RoomsFail | RoomHandle>
join: (invite, options?) => Promise<RoomsFail | RoomHandle>;Parameters
Section titled “Parameters”invite
Section titled “invite”string
options?
Section titled “options?”Returns
Section titled “Returns”Promise<RoomsFail | RoomHandle>
setOverlayHost
Section titled “setOverlayHost”setOverlayHost: SetOverlayHost;shell: object;applyUpdate
Section titled “applyUpdate”applyUpdate: () => Promise<boolean>;Returns
Section titled “Returns”Promise<boolean>
onUpdate
Section titled “onUpdate”onUpdate: (callback) => () => void;Parameters
Section titled “Parameters”callback
Section titled “callback”() => void
Returns
Section titled “Returns”() => void
onUpdateTaken
Section titled “onUpdateTaken”onUpdateTaken: (callback) => () => void;Parameters
Section titled “Parameters”callback
Section titled “callback”() => void
Returns
Section titled “Returns”() => void
updateReady
Section titled “updateReady”updateReady: () => Promise<boolean>;Returns
Section titled “Returns”Promise<boolean>
showInstallPrompt
Section titled “showInstallPrompt”showInstallPrompt: (reason?) => Promise<void>;Parameters
Section titled “Parameters”reason?
Section titled “reason?”string
Returns
Section titled “Returns”Promise<void>
webVpnTcpSocket
Section titled “webVpnTcpSocket”webVpnTcpSocket: (options) => Promise<TcpSocketResult>;Parameters
Section titled “Parameters”options
Section titled “options”Returns
Section titled “Returns”webVpnTcpSocketListener
Section titled “webVpnTcpSocketListener”webVpnTcpSocketListener: (options) => Promise<TcpSocketListenerResult>;Parameters
Section titled “Parameters”options
Section titled “options”Returns
Section titled “Returns”Promise<TcpSocketListenerResult>
webVpnUdpSocket
Section titled “webVpnUdpSocket”webVpnUdpSocket: (options) => Promise<UdpSocketResult>;Parameters
Section titled “Parameters”options
Section titled “options”Returns
Section titled “Returns”RoomCreateOptions
Section titled “RoomCreateOptions”type RoomCreateOptions = object;Properties
Section titled “Properties”defaults?
Section titled “defaults?”optional defaults?: Partial<RoomDefaults>;members?
Section titled “members?”optional members?: number;signal?
Section titled “signal?”optional signal?: AbortSignal;aborting it leaves the room; it never bounds the wait for the broker
RoomDefaults
Section titled “RoomDefaults”type RoomDefaults = Readonly<{ receive: boolean; send: boolean;}>;RoomEnd
Section titled “RoomEnd”type RoomEnd = object;Why the room ended for this app. It ends once.
Properties
Section titled “Properties”reason
Section titled “reason”reason: "left" | "removed" | "blocked" | "ended" | "unavailable";RoomEvent
Section titled “RoomEvent”type RoomEvent = | { message: RoomMessage; type: "message";} | { member: RoomMember; type: "joined";} | { id: string; reason: "left" | "removed" | "blocked"; type: "left";} | { id: string; permissions: RoomPermissions; type: "permissions";} | { defaults: RoomDefaults; type: "defaults";};RoomHandle
Section titled “RoomHandle”type RoomHandle = object;A joined room, held by the broker: it owns the socket, the room key and the derived message key, and hands the app plaintext and member ids only.
Every member that can be refused answers with a RoomsFail rather than throwing, so a refusal
survives the osra hop as data. leave and on cannot be refused.
Properties
Section titled “Properties”block: (id) => Promise< | RoomsFail | { ok: true;}>;Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”Promise<
| RoomsFail
| {
ok: true;
}>
closed
Section titled “closed”closed: Promise<RoomEnd>;settles once, when the room ends for this app. Never rejects.
defaults
Section titled “defaults”defaults: () => Promise<RoomDefaults>;Returns
Section titled “Returns”grant: (id, permission) => Promise< | RoomsFail | { ok: true;}>;Parameters
Section titled “Parameters”string
permission
Section titled “permission”Returns
Section titled “Returns”Promise<
| RoomsFail
| {
ok: true;
}>
id: string;the room’s uuid
invite
Section titled “invite”invite: string;id and key as one string, the thing to put in a link
key: string;the room key, base64url. The api never sees it. Anyone holding it and the id can join.
leave: () => Promise<void>;Returns
Section titled “Returns”Promise<void>
members
Section titled “members”members: () => Promise<RoomMember[]>;Returns
Section titled “Returns”on: (listener) => () => void;the account.onChange shape: one broker-side registration, unsubscribed by the returned function
Parameters
Section titled “Parameters”listener
Section titled “listener”(event) => void
Returns
Section titled “Returns”() => void
owner: string;remove
Section titled “remove”remove: (id) => Promise< | RoomsFail | { ok: true;}>;Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”Promise<
| RoomsFail
| {
ok: true;
}>
revoke
Section titled “revoke”revoke: (id, permission) => Promise< | RoomsFail | { ok: true;}>;Parameters
Section titled “Parameters”string
permission
Section titled “permission”Returns
Section titled “Returns”Promise<
| RoomsFail
| {
ok: true;
}>
self: RoomMember;send: (text) => Promise< | RoomsFail | { ok: true;}>;at most 4,096 bytes of UTF-8, sealed before it leaves the browser; never truncated
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”Promise<
| RoomsFail
| {
ok: true;
}>
setDefault
Section titled “setDefault”setDefault: (permission, value) => Promise< | RoomsFail | { ok: true;}>;Parameters
Section titled “Parameters”permission
Section titled “permission”"send" | "receive"
boolean
Returns
Section titled “Returns”Promise<
| RoomsFail
| {
ok: true;
}>
unblock
Section titled “unblock”unblock: (id) => Promise< | RoomsFail | { ok: true;}>;Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”Promise<
| RoomsFail
| {
ok: true;
}>
RoomJoinOptions
Section titled “RoomJoinOptions”type RoomJoinOptions = object;Properties
Section titled “Properties”signal?
Section titled “signal?”optional signal?: AbortSignal;RoomMember
Section titled “RoomMember”type RoomMember = object;A participant as this room sees them. The id is fresh in every room.
Properties
Section titled “Properties”id: string;permissions
Section titled “permissions”permissions: RoomPermissions;RoomMessage
Section titled “RoomMessage”type RoomMessage = object;Properties
Section titled “Properties”at: number;from: string;seq: number;text: string;RoomPermission
Section titled “RoomPermission”type RoomPermission = "send" | "receive" | "remove" | "block";RoomPermissions
Section titled “RoomPermissions”type RoomPermissions = Readonly<Record<RoomPermission, boolean>>;RoomsErrorCode
Section titled “RoomsErrorCode”type RoomsErrorCode = | "invalid" | "not-found" | "bad-key" | "full" | "blocked" | "denied" | "rate-limited" | "too-large" | "unavailable" | "closed";RoomsFail
Section titled “RoomsFail”type RoomsFail = object;A refusal, as data. packages crosses the hop the same way, and for the same reason.
Properties
Section titled “Properties”error: RoomsErrorCode;message
Section titled “message”message: string;SetOverlayHost
Section titled “SetOverlayHost”type SetOverlayHost = (push, options?) => void;Parameters
Section titled “Parameters”(state) => unknown
options?
Section titled “options?”exactClips?
Section titled “exactClips?”boolean
Returns
Section titled “Returns”void
StorageEntry
Section titled “StorageEntry”type StorageEntry = object;Properties
Section titled “Properties”contentType
Section titled “contentType”contentType: string | null;encryption
Section titled “encryption”encryption: string | null;path: string;size: number;updatedAt
Section titled “updatedAt”updatedAt: string;StorageQuota
Section titled “StorageQuota”type StorageQuota = object;Properties
Section titled “Properties”limitBytes
Section titled “limitBytes”limitBytes: number;maxObjects
Section titled “maxObjects”maxObjects: number;objects
Section titled “objects”objects: number;remaining
Section titled “remaining”remaining: number;usedBytes
Section titled “usedBytes”usedBytes: number;SurfaceRect
Section titled “SurfaceRect”type SurfaceRect = object;viewport coordinates, the space both the app and the broker frame measure in
Properties
Section titled “Properties”height
Section titled “height”height: number;width: number;x: number;y: number;TcpSocketListenerOptions
Section titled “TcpSocketListenerOptions”type TcpSocketListenerOptions = object;Properties
Section titled “Properties”localAddress
Section titled “localAddress”localAddress: string;localPort
Section titled “localPort”localPort: number;onClose?
Section titled “onClose?”optional onClose?: (error?) => void | Promise<void>;Parameters
Section titled “Parameters”error?
Section titled “error?”Error
Returns
Section titled “Returns”void | Promise<void>
onConnection
Section titled “onConnection”onConnection: (connection) => void | Promise<void>;Parameters
Section titled “Parameters”connection
Section titled “connection”Returns
Section titled “Returns”void | Promise<void>
TcpSocketListenerResult
Section titled “TcpSocketListenerResult”type TcpSocketListenerResult = object;Properties
Section titled “Properties”close: () => Promise<void>;Returns
Section titled “Returns”Promise<void>
localAddress
Section titled “localAddress”localAddress: string;localFamily
Section titled “localFamily”localFamily: IpFamily;localPort
Section titled “localPort”localPort: number;TcpSocketOptions
Section titled “TcpSocketOptions”type TcpSocketOptions = object;Properties
Section titled “Properties”remoteAddress
Section titled “remoteAddress”remoteAddress: string;remotePort
Section titled “remotePort”remotePort: number;TcpSocketResult
Section titled “TcpSocketResult”type TcpSocketResult = object;Properties
Section titled “Properties”dataReadableStream
Section titled “dataReadableStream”dataReadableStream: ReadableStream<Uint8Array>;dataWritableStream
Section titled “dataWritableStream”dataWritableStream: WritableStream<Uint8Array>;destroy
Section titled “destroy”destroy: () => Promise<void>;Returns
Section titled “Returns”Promise<void>
destroySoon
Section titled “destroySoon”destroySoon: () => Promise<void>;Returns
Section titled “Returns”Promise<void>
end: () => Promise<void>;Returns
Section titled “Returns”Promise<void>
localAddress
Section titled “localAddress”localAddress: string;localFamily
Section titled “localFamily”localFamily: IpFamily;localPort
Section titled “localPort”localPort: number;remoteAddress
Section titled “remoteAddress”remoteAddress: string;remoteFamily
Section titled “remoteFamily”remoteFamily: IpFamily;remotePort
Section titled “remotePort”remotePort: number;resetAndDestroy
Section titled “resetAndDestroy”resetAndDestroy: () => Promise<void>;Returns
Section titled “Returns”Promise<void>
setOption
Section titled “setOption”setOption: (option) => Promise<void>;Parameters
Section titled “Parameters”option
Section titled “option”Returns
Section titled “Returns”Promise<void>
UdpDatagram
Section titled “UdpDatagram”type UdpDatagram = object;Properties
Section titled “Properties”address
Section titled “address”address: string;data: ArrayBuffer;family
Section titled “family”family: IpFamily;port: number;size: number;UdpSocketOptions
Section titled “UdpSocketOptions”type UdpSocketOptions = object;Properties
Section titled “Properties”address
Section titled “address”address: string;dataPort?
Section titled “dataPort?”optional dataPort?: boolean;port: number;type: "udp4" | "udp6";UdpSocketResult
Section titled “UdpSocketResult”type UdpSocketResult = object;Properties
Section titled “Properties”close: () => Promise<void>;Returns
Section titled “Returns”Promise<void>
closed
Section titled “closed”closed: Promise<{ reason: string;}>;connect
Section titled “connect”connect: (options) => Promise<{ address: string; family: IpFamily; local: boolean; port: number;}>;Parameters
Section titled “Parameters”options
Section titled “options”remoteAddress
Section titled “remoteAddress”string
remotePort
Section titled “remotePort”number
Returns
Section titled “Returns”Promise<{
address: string;
family: IpFamily;
local: boolean;
port: number;
}>
dataPort
Section titled “dataPort”dataPort: MessagePort | undefined;dataPortAcks
Section titled “dataPortAcks”dataPortAcks: true | undefined;dataReadableStream
Section titled “dataReadableStream”dataReadableStream: ReadableStream<UdpDatagram>;disconnect
Section titled “disconnect”disconnect: () => Promise<void>;Returns
Section titled “Returns”Promise<void>
localAddress
Section titled “localAddress”localAddress: string;localFamily
Section titled “localFamily”localFamily: IpFamily;localPort
Section titled “localPort”localPort: number;send: (options) => Promise<void>;Parameters
Section titled “Parameters”options
Section titled “options”address?
Section titled “address?”string
message
Section titled “message”ArrayBuffer
number
Returns
Section titled “Returns”Promise<void>
setOption
Section titled “setOption”setOption: (option) => Promise<void>;Parameters
Section titled “Parameters”option
Section titled “option”Returns
Section titled “Returns”Promise<void>
socketId
Section titled “socketId”socketId: number;WriteData
Section titled “WriteData”type WriteData = ArrayBuffer | Uint8Array | string;References
Section titled “References”TcpSocketOption
Section titled “TcpSocketOption”Re-exports TcpSocketOption
UdpSocketOption
Section titled “UdpSocketOption”Re-exports UdpSocketOption