interface RunicInstance One Runic page runtime: a Views connection over one Bridge, with its own connection state, diagnostics, translated text, window locale, appearance, fields and kept clients. The page instance is the document's own (pageInstance()), which the served host bootstrap installs __runicBridge for; createRunicInstance makes others, such as one per embedded component.
Properties
page
readonly page: boolean; Whether this is the page instance, whose Bridge is globalThis.__runicBridge.
bridge
readonly bridge: RunicBridgeClient | undefined; The instance's Bridge; for the page instance, the one installed now, if any.
Methods
run
run<T>(run: () => T): T; Runs run with this instance as the current one and returns its result. What run calls synchronously belongs to this instance: a generated connect{View} call, a controller it creates, onBridgeConnection, onBridgeDiagnostic, the text and locale functions, appearance(), commitAllFields() and the like. What they start keeps the instance after run returns; code after an await inside run does not, so call run again there.
dispose
dispose(): void; Ends the instance: stops listening to its Bridge, reports its Views and operations disconnected, and stops its onBridgeConnection listeners at their last state. A connect call in the instance afterwards rejects with an unavailable BridgeError. The page instance is never disposed: calling it there throws a TypeError.