@runic-artifex/views

Version 0.23.0. Read from the published package.

@runic-artifex/views

appearance function

The appearance of the current instance (the page's, outside RunicInstance.run) now: the colour scheme, contrast and reduced motion of the page's engine combined with the desktop's appearance that a Runic host pushes (appearance/1, RunicDesktopHost in .NET), which also carries the text scale, the accent colour and the forced-colours palette; engine and host report each source alone.

Appearance interface

The page's appearance.

AppearanceColorScheme type alias

A light or dark colour scheme.

AppearanceContrast type alias

The contrast preference: none, more contrast with the page's own colours, or colours that the desktop forces on the page (CSS forced-colors: active).

appearanceFeature constant

appearance/1: the desktop's appearance that the host pushes to its pages.

AppearanceSystemColors interface

The palette a desktop forces while contrast is "forced-colors", as #rrggbb colours named after the CSS system colours.

attachField function

Wires an <input>, <textarea> or <select> to a field controller until the returned function is called: it writes the text typed (input events; change of a <select> or a checkbox, whose checked is the value), writes nothing during IME composition, commits on blur, keeps the element's text (a checkbox's checked) equal to the field's without moving the caret while it already shows it, and sets aria-invalid while the field has errors or an error.

BackNavigationOptions interface

Options of installBackNavigation.

bindField function

Binds an element to one member of a connected client: creates a createFieldController for a generated descriptor such as EditorFields.title (or any definition with read and write), follows the client's state and wires the element as attachField does.

BlobRef interface

A file the page uploaded with upload(): pass it to a command whose .NET parameter is a RunicUpload.

blobsFeature constant

The feature name of blobs and uploads.

BoundField interface

A field that bindField wired to an element and a client.

BridgeCallChannel interface

The value at globalThis[Symbol.for("runic.views.calls")] (an instance's slots).

BridgeCallEvent type alias

What the Bridge-call channel reports.

BridgeCallHandler interface

The C# handler of a call, from a .NET host in Development (handler-timing/1): its name, such as EditorViewModel.Save, and its duration in milliseconds as .NET measured it.

BridgeCallIdentity interface

What identifies one call in both of its events.

BridgeCallKind type alias

What a generated client call does: command (also a command with a declared failure), set (a property setter), write (a checked field write), can (command availability), region (select or close a region), operation (the start or recovery of a long-running command), query (a query collection's query, rows or index).

BridgeCallListener type alias

A reader of the Bridge-call channel.

BridgeCallOutcome type alias

How a call ended: ok; error (it rejected, or a command answered with its declared failure); cancelled (nothing ran for it, or its answer no longer applies: superseded, released, aborted or cancelled).

BridgeCallTrace interface

A call's W3C trace context: the page's span for the call, as traceparent and optionally tracestate.

BridgeConnectionOptions interface
BridgeConnectionState type alias

The connection between this page and its .NET host. - connecting: the Bridge has not connected yet. - connected: the Bridge is connected. - reconnecting: the connection dropped and the host transport is trying to restore it. - lost: the Bridge has not been connected for lostAfter milliseconds, or never connected in that time.

BridgeConnectOptions interface

Options of a generated connect<Name>() function.

BridgeDiagnostic interface

A failure or terminal event the Views runtime observed.

BridgeDiagnosticCode type alias

What a BridgeDiagnostic reports: a BridgeErrorKind other than released (a call of a released View is expected after navigation and is not reported), uncertain for a BridgeOperationUncertainError, timed-out for an operation wait that passed its timeout, protocol for a host that speaks another Views protocol version, version for a .NET Runic.Application.Views of another release than this @runic-artifex/views (no other producer is compared), revision-timeout for a reply whose revision the route did not reach within 5 seconds (a producer bug: the client then reads a snapshot), stale-input for script that wrote an older value into a focused input while a request was in flight (@runic-artifex/vite-plugin-runic in development), or reported for an application error the runtime caught.

BridgeDiagnosticListener type alias
BridgeError class

A Bridge call that .NET or the transport did not complete.

BridgeErrorKind type alias

Why a Bridge call did not complete.

BridgeErrorOptions interface
BridgeErrorReason type alias

Refines a BridgeError kind (specs/application, "Errors").

bridgeFailure function

An outcome with the declared failure.

BridgeFailureDetail interface

Failure detail that a producer adds to an error reply only in development (.NET: host environment Development, or the window option IncludeFailureDetail).

BridgeField interface

A generated descriptor of one settable View member, such as EditorFields.title: how a field reads it from the View's state, writes it, and finds its validation messages.

BridgeFieldConstraints interface

The C# validation attributes of a member (DataAnnotations), which a page can mirror on its input, such as maxlength and required.

BridgeFieldKind type alias

How a field's value is edited, which selects its text form and input wiring: - text: a TypeScript string (strings, Guid, durations, and dates of releases before 0.16); - number: a number; integer is set for integer CLR types; - decimal: a string in the decimal wire form ("-1234.50"), exact; its text uses the field's locale; - bigint: a bigint (long, ulong, BigInteger); - date: a string YYYY-MM-DD (DateOnly), the form of <input type="date">; - time: a string hh:mm:ss[.f] (TimeOnly); its text drops zero seconds, as <input type="time"> does; - datetime: a string date and time (DateTime, and DateTimeOffset with offset); its text is the page's local date and time, the form of <input type="datetime-local">; - boolean: a boolean, edited with a checkbox; - choice: an enum name, one of choices; - value: any other value (objects, lists, unions, custom codecs), which has no text form.

BridgeInteractionContext interface
BridgeOperation interface

A recoverable command execution identified by its request id (the protocol's operation id).

BridgeOperationCancelKind type alias
BridgeOperationCancelResult interface
BridgeOperationDeliveryFailure interface

Why a completed operation's result or failure could not be delivered.

BridgeOperationDeliveryFailureKind type alias

Why a completed operation's result or failure could not be delivered (specs/application, "Status").

BridgeOperationStartOptions interface

Options of a generated start{Command}() call.

BridgeOperationStatus type alias

The status of an operation, discriminated by kind.

BridgeOperationStatusKind type alias

domain-failed means the command failed with its declared failure type.

BridgeOperationStatusOf type alias

Every operation status, including domain-failed.

BridgeOperationStreamItem interface
BridgeOperationStreamPage interface

One page of a stream operation's items.

BridgeOperationUncertainError class

The client could not observe whether .NET admitted or completed an operation, so its outcome is unknown: do not retry it blindly.

BridgeOperationUncertainErrorOptions interface

The identity of an operation whose outcome the client could not observe.

BridgeOperationWaitOptions interface
BridgeOutcome type alias

How a command or operation that declares a failure type ended: ok with its value, or not ok with the declared failure.

BridgeOutcomeFailure type alias

The declared failure type of a command result: F for a BridgeOutcome<_, F>, otherwise never.

BridgeRowFields interface

The cells of a keyed collection's rows, such as InvoiceFields.lines: at(key) returns the descriptors of one row's cells, the same object for the same key, so a framework binding keeps its field across renders.

BridgeStreamOperation interface

An operation whose command yields a stream of TItem values, read through stream().

bridgeSuccess function

A successful outcome with value.

BridgeValidationMessage interface
BridgeValidationState interface
BridgeViewRequestContext interface

What a view request handler receives besides its input.

BridgeViewRequestHandler type alias

Handles one view request of a View: a one-way presentation action the ViewModel raised, such as focusing a field or showing a toast.

ClientErrorReport interface

One error as it is sent to the host, after trimming and redaction.

ClientErrorSource type alias

Where a reported error came from.

ClientLanguagesOptions interface

Options of configureClientLanguages.

collectionViewport function

Computes a bounded viewport for fixed-height rows in any web framework.

CollectionViewport interface
CollectionViewportController interface

Follows a scroll container and publishes its CollectionViewport.

CollectionViewportOptions interface

The list a viewport controller measures: its row count, fixed row height and overscan.

CommandController interface

Runs a command and tracks whether it is pending and why it last failed.

CommandState interface

One consistent reading of a CommandController.

commitAllFields function

Commits every field of the current instance (the page's, outside RunicInstance.run) that holds a draft, such as a commit: "pause" draft not written yet, and resolves once their writes settled.

commitFields function

Commits fields and waits for their writes, so a command that depends on them, such as Save, can follow.

configureClientLanguages function

Configures what the current instance (the page, outside RunicInstance.run) reports in hello for client-languages/1.

configureFieldErrorText function

Sets the application's text for field errors (FieldState.error): resolveText, the framework packages' useText and runicText, and describeBridgeError show a FieldError with it, in the window's language.

configureRunicText function

Sets the text of Runic's own page text (RunicTextKey): the sentences describeBridgeError writes and the key names formatShortcut writes, in the window's language.

configureTranslatedText function

Connects the Translations runtime of the current instance (the page's, outside RunicInstance.run): resolveText, useText and the framework helpers format references with it, and the window's locale, when the application sets one, is passed to its setLocale.

createCollectionViewportController function

Creates the framework-neutral viewport tracker behind each binding's useCollectionViewport.

createCommandController function

Creates the framework-neutral command runner behind useCommand and injectCommand.

createFieldController function

Creates a FieldController for a generated BridgeField, such as EditorFields.title, or any definition with read and write.

createFormController function

Creates a FormController over field controllers, such as createFieldController results:

createLatestOperationController function

Serializes read admission, coalescing input received during delayed Start receipts and cancellation.

createMenuBarController function

Follows the host's in-page menu bar: the declared DesktopHost.MenuBar with the commands' availability, for the application's own menubar component.

createOperationController function

Framework-neutral operation feedback.

createQueryCollection function

Creates the rows of a query collection for one presentation.

createQueryViewportController function

Creates the variable-height viewport of a query collection.

createRowSizes function

Creates the sizes of count rows, each estimate until measured.

createRunicInstance function

Creates a Runic instance on options.bridge.

createTextFieldController function

Creates a TextFieldController: createFieldController for a string member read and written by the given functions.

createViewController function

Creates the framework-neutral controller behind useView and injectView.

currentInstance function

The current instance: that of the innermost RunicInstance, or the defaultInstance.

defaultInstance function

The instance that code uses outside RunicInstance and outside a framework binding's instance provider.

describeBridgeError function

One sentence that tells a user what went wrong, for a status line or an alert, instead of String(error) ("BridgeError: …"), in the window's language when the page has Runic's text (configureRunicText, which configureRunicViewsText() of @runic-artifex/views-translations sets).

DocumentLocaleOptions interface

Where syncDocumentLocale sets the language.

EngineAppearance interface

What the page's engine reports through its CSS media queries, which is what the page's CSS sees.

ErrorReportingOptions interface

Options of installErrorReporting.

FieldBaseline type alias
FieldCommit type alias

When a field writes what the user typed.

FieldController interface

A framework-neutral binding of one View member to an input (@runic-artifex/angular, react, vue and svelte wrap it as useField / injectField).

FieldDefinition type alias

What a field controller needs of a member: a generated BridgeField, or read and write with any of the other members.

FieldElement type alias

The elements attachField and bindField wire.

FieldError class

A checked write's receipt that is not a plain success, or a text that does not parse.

FieldErrorArguments interface

The parts of an invalid-text message (FieldErrorReason); each reason sets the ones its row lists.

FieldErrorDetail interface

The reason and arguments of a FieldError, for its constructor.

FieldErrorExpected type alias

The value a required text names (Enter a number., Enter a date and time.).

FieldErrorKind type alias

Why a field's write or text did not take effect (FieldState.error): - rejected: the checked write's setter refused the value; the field is unchanged and the draft is kept; - conflict: another writer changed the field since the draft started; current is its value and version, the draft is kept and nothing is written until retry() or reset(); - committed-with-error: the value was committed, then the setter or its validation failed; current is the committed field; - invalid-text: the text typed into the field is not a value of its kind, such as 1e for a number; nothing is written.

FieldErrorReason type alias

Why a text does not parse (invalid-text), for an application that shows its own text: the error's FieldError carry the parts of the message, and message stays the English text. | Reason | English message | Arguments | | --- | --- | --- | | required | Enter a number. | expected | | not-a-number | 1e is not a number. | text | | not-a-whole-number | 1.5 is not a whole number. | text | | too-many-fraction-digits | 1.234 has more than 2 digits after the decimal separator. | text, scale | | out-of-range | …9 is too large. (a decimal of 2⁹⁶ or more) | text | | not-a-boolean | yes is not true or false. | text | | not-a-choice | Large is not one of Small, Medium. | text, choices | | not-a-date | 31.02.2026 is not a date., x is not a date (DD.MM.YYYY or YYYY-MM-DD). | text, patterns? | | not-a-time | 25:00 is not a time., x is not a time (hh:mm or hh:mm:ss). | text, patterns? | | not-a-date-time | x is not a date and time (YYYY-MM-DDThh:mm). | text, patterns | | offset-out-of-range | …+15:00 has an offset beyond ±14:00. | text | | no-text-form | This field has no text form. | none | not-a-date and not-a-time without patterns are a text of the right form that names no day or time, such as 31 February.

fieldErrorsAt function

The validation messages of the value at a validation path and below it, in validation order, such as ["lines", 2, "quantity"] for a cell of the third row (generated code calls it for a field path's errors).

fieldErrorText function

The text to show for a field error: the text configureFieldErrorText gives it in textLocale, or its English message.

FieldErrorText type alias

The application's text for a field error, as configureFieldErrorText takes it: the text to show for error in locale (the locale references are shown in, textLocale), or undefined to show its English message.

FieldOptions interface
FieldSource interface

The View a field reads and writes: its latest state and the client to write with.

FieldState interface

What a field shows.

fieldValidatingAt function

Whether the validation of the value at a validation path, or of a value below it, is in progress: a validation.pending path starts with path (validation-pending/1).

FieldWriteOptions type alias
FieldWriteReceipt type alias
formatShortcut function

The shortcut as the platform shows it, such as ⇧⌘S on Apple platforms and Ctrl+Shift+S elsewhere; "" for invalid text.

FormController interface

One state over a View's fields (createFieldController): whether the form is dirty, settled and valid, and a submit that writes every field before its command, so Save never runs before the last keystroke reached .NET.

FormField interface

What a form needs of a field: a field controller, or a framework binding's field handle.

FormFieldController type alias

A field controller as a form reads it.

formFieldList function

The fields of a list or record, in order.

FormFields type alias

The fields of a form: a list, or a record such as { title, body }.

FormFieldState type alias

What submit reads of a field's state now.

FormOptions interface
FormState interface

The state of a form: what its fields show, combined.

formStateOf function

Combines field states into a FormState.

FormSubmitOptions interface
FormSubmitResult type alias

How a submit ended: - submitted: the fields' writes settled and the command ran; result is what it returned; - field-failed: a field's value did not reach the View, so the command did not run; error is the first such field's error: a text that does not parse (invalid-text), a rejected or conflict checked write, or a transport failure of this submit's writes.

HostAppearance interface

The desktop's appearance as the host pushed it (appearance/1).

HostUploadRequest interface

One upload as a host bridge sends it itself (HostUploads).

HostUploads interface

An optional member of the host bridge (globalThis.__runicBridge): a host that sends uploads itself, such as the mock Bridge, implements it.

installBackNavigation function

Maps the mouse's Back button (button 3), Alt+Left, Cmd+[ on macOS and the keyboard's Browser Back key to the window's Back, so they go back in its innermost presented region on Runic Desktop and CS-WebUI alike.

installErrorReporting function

Reports the page's uncaught errors, unhandled promise rejections and the errors the Views runtime catches to the .NET host, which logs them through ILogger in the category Runic.Application.Views.Page (event 1150).

installNavigationPath function

Keeps the URL's fragment and the browser's history in step with the window's route path (navigation-path/1): - A change of the path region pushes a history entry, goes back to the previous one, or replaces the current one.

InteractionSurface interface
isApplePlatform function

Whether the page runs on macOS, iOS or iPadOS, where Primary is Command.

isBridgeError function

True when error is a BridgeError, of kind or one of the kinds when given.

isBridgeOutcome function

True for an outcome created by bridgeSuccess or bridgeFailure, including by another copy of this package.

LatestOperationController interface
LatestOperationIntent interface

A captured selection, including the connection/session against which it is valid.

LatestOperationState interface
matchCase function

Handles every case of a $case union, such as a declared failure:

matchesShortcut function

Whether a keydown event is the shortcut, with exactly its modifiers.

maximumQueryRange constant

The most rows one range has.

MenuBarController interface

The headless in-page menu bar.

MenuBarControllerOptions interface

Options of createMenuBarController.

MenuBarEntry type alias

An entry of a menu.

MenuBarInvokeResult type alias

What MenuBarController did: executed the command ran; disabled it cannot run now; stale the bar changed since the item was rendered.

MenuBarItem interface

A menu item.

MenuBarMenu interface

A menu of the bar, or a submenu.

MenuBarRequest type alias

A keyboard request for the page's menubar component: focus its first menu (an Alt tap or F10) or open a menu (Alt plus the menu's access key).

MenuBarSeparator interface

A separator line.

MenuBarState interface

The menu bar as the page renders it.

navigateBack function

Goes back in the window as its Back button does: the .NET RunicNavigator.BackAsync, in the innermost presented region that can go back, through its departure guards.

NavigationPathChange interface

A change of the window's route path.

navigationPathFeature constant

navigation-path/1 (specs/application/README.md, "Navigation paths"): the window's Back and its route path.

NavigationPathOperation type alias

How the page changes its history for a new route path: a new entry, back to the previous one, or in place.

NavigationPathOptions interface

Options of installNavigationPath.

NavigationReply interface

The reply to navigateBack and openNavigationPath.

NavigationWindow interface

The parts of the page's window that the navigation installs use; tests pass a stand-in.

normalizeQuery function

The canonical wire form of a query: sort and filters present, members in the producer's order.

onAppearance function

Calls listener with the current instance's appearance each time it changes, from the engine's media queries or a host push, until the returned function is called.

onBridgeConnection function

Observes the current instance's connection to its .NET host (the page's, outside RunicInstance.run).

onBridgeDiagnostic function

Observes Views runtime failures of the current instance (the page's, outside RunicInstance.run): failed routes (with their .NET detail in development), a missing or unconnected Bridge, operation timeouts and errors the runtime caught from listeners.

onBridgeDraining function

The close drain (0.19, stable since 0.22): observes whether the application closed the current instance's window (the page's, outside RunicInstance.run) with a close drain.

onNavigationPath function

Calls listener with the window's route path: once the connection's hello reports it (with operation: "replace"), and after each change of the path region.

onWindowLocale function

Calls listener with the window's locale each time the application changes it, until the returned function is called.

openNavigationPath function

Opens a route path, such as customers/42, in the window's path region, as a browser's Back, Forward or address bar does: back to the page with that route when the region's history has one, otherwise a push, through the departure guards.

OperationController interface
OperationControllerOptions interface
OperationState interface

Feedback for the latest run; pending includes every run still being observed.

pageInstance function

The page instance: the document's own, on globalThis.__runicBridge and the shared global keys.

PageReference interface

A generated content reference: a View presented in a content slot, such as a ViewModel slot of .NET PageReference.

parseShortcut function

Reads a shortcut such as Primary+Shift+S; null when the text is not one.

preloadView function

Connects a connector ahead of the component that shows it, such as in a router's load function, and keeps the client for keepAlive milliseconds: the first useView / injectView that follows the connector takes it over with its state, so the component renders the View at once instead of "Connecting…".

PreloadViewOptions interface
QueryCollection interface

The rows of one query collection for one presentation.

QueryCollectionQuery interface

A query as the producer publishes it: every member present.

QueryCollectionSnapshot interface

What a query collection shows for its range.

QueryCollectionState interface

The state member of a query collection: its query, the number of matching rows, and its version.

QueryRow interface

One row of a query collection's range: loaded, or a placeholder.

QueryViewport interface

What a query viewport shows.

QueryViewportController interface

Follows a scroll container for a query collection: it asks the collection for the rows the container shows and lays them out with variable heights.

QueryViewportItem interface

A row of a query viewport, with its layout.

QueryViewportOptions interface
RegionCollection interface

A region collection member of generated state, such as state.documents: the regions in order and the selected index.

regionCollectionsFeature constant

region-collections/1: region collection members, and region requests that select or close a region by key.

regionEntries function

The regions of collection with their index and whether each is selected; empty for null or undefined.

RegionEntry interface

One region of a collection with its position, as regionEntries lists it for an outlet or a tab bar.

RegionOutcome interface

How a select{Name}(key) or close{Name}(key) ended: the .NET NavigationOutcome of the request.

RegionSlot interface

One region of a RegionCollection.

registryEntries function

One entry per kind with the same component, to spread into a ViewRegistry, such as { ...registryEntries(resultPageKinds, ResultPageView), settings: SettingsView } satisfies ViewRegistry<State["main"]> for a generated shared client's kinds.

resolveText function

The text to show for a value of a TextReference member: the reference formatted in the window's language (textLocale), its fallbackText when it cannot be formatted or no Translations runtime is configured, then fallback, then its key.

RowSizeEstimate type alias

An estimated row size: a number, or one per row.

RowSizes interface

The size of every row of a list, measured or estimated.

RunicBlob interface

Binary content that a ViewModel exposes: a .NET RunicBlob.

RunicBridgeClient interface

The host bridge a host script installs as globalThis.__runicBridge (Views protocol 4, specs/application, "Host bridge"), or that createRunicInstance is given.

RunicFilter type alias

One filter of a RunicQuery.

RunicInstance interface

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.

RunicInstanceOptions interface

Options of createRunicInstance.

RunicQuery interface

The sort and filter of a query collection.

RunicSortKey interface

One sort key of a RunicQuery.

runicText function

Runic's text for key in textLocale: the text configureRunicText gives it, or Runic's English text.

RunicText type alias

The application's text for Runic's own page text, as configureRunicText takes it: the text of key in locale (the locale references are shown in, textLocale), or undefined for Runic's English text.

RunicTextKey type alias

A text Runic writes on the page itself, named after its message in the runic-views catalog (bridge.failed is the message failed of the group bridge).

runicTextKeys constant

Every RunicTextKey, for a test that checks that an application's hook covers them.

selectedRegion function

The selected region of collection, or undefined when it has none.

sharedPageReferences constant

The type-only key under which a generated {Name}PageReference names the shared page references it extends, such as ResultPagePageReference for a ViewModel that implements a .NET [RunicSharedClient] interface IResultPage.

SharedPageReferences type alias

The shared page references ([RunicSharedClient]) that a generated page reference extends; never when it has none.

Shortcut interface

A shortcut read by parseShortcut: its normalized key and modifiers.

ShortcutEvent interface

The parts of a KeyboardEvent a shortcut reads.

shortcutFromEvent function

The shortcut text that DesktopShortcut.Parse reads for a keydown event, such as Primary+Shift+S, so a page can record the key a user chooses and send it through an ordinary command; null for a press that is not a shortcut.

ShortcutModifier type alias

A modifier of a shortcut.

ShortcutOptions interface

Which platform's rule matchesShortcut and formatShortcut apply.

shortcutText function

The shortcut as parseShortcut reads it, in canonical order: Primary+Control+Alt+Shift+Key.

splitAccessKey function

Splits an entry's label around its access key, to underline the key while accessKeyHints is true.

submitFields function

Commits every field, waits for their writes and, unless a value did not reach the View, runs command.

subscribeText function

Calls listener whenever text resolves differently: the window's locale or the page's Translations locale changed, or a runtime or the field error text was configured.

syncDocumentLocale function

Sets lang and dir of the page's root element to the language that text references are shown in (textLocale, textDirection), now and after every language switch, until the returned function is called.

textDirection function

The writing direction of the text locale (textLocale): the Translations runtime's direction, or the direction of the locale's script.

TextFieldController type alias

A framework-neutral text input binding for one View member: the string case of FieldController, which @runic-artifex/angular, react, vue and svelte wrap as injectTextField / useTextField.

TextFieldControllerOptions interface
TextFieldSource type alias

The View a text field reads and writes: its latest state and the client to write with.

TextFieldState type alias

What a text field shows: a FieldState of a string.

textLocale function

The locale in which references are shown: the Translations runtime's locale, or the window's locale when the runtime cannot follow it.

TextReference interface

A text reference of Runic Translations (the text-reference wire type, values.md): a catalog, a message key, typed arguments and an optional fallback text, as the Translations transport writes it.

TextTranslations interface

The application's Translations runtime, as configureTranslatedText takes it.

textVersion function

A number that changes whenever text resolves differently, for framework snapshots.

unknownAppearance constant

The appearance with every member null: what appearance reports under server rendering, and the server snapshot of the framework hooks.

upload function

Uploads a file to the .NET host of the current instance (the page's window, outside RunicInstance.run) and resolves with its reference, which a command whose .NET parameter is a RunicUpload takes.

UploadOptions interface

Options of upload.

UploadProgress interface

The progress of an upload.

ViewClient interface

The framework-neutral surface every generated client shares.

ViewConnector interface

Anything that connects a client: a generated page reference or { connect: connect<Name> }.

ViewController interface

The connect, observe and release state machine that every framework binding shares.

ViewControllerOptions interface
ViewControllerState interface

One consistent reading of a ViewController.

ViewRegistryPage type alias

The page types that a ViewRegistry entry for kind K of R may accept: the kind's own reference and each shared page reference it extends.

ViewRequestSurface interface

One view request of a generated client: client.requests.<name>.

ViewSource type alias

What a framework binding follows.

waitForBridge function

Waits for the current instance's host Bridge (the installed __runicBridge on the page) to report a connection to .NET.

WaitForBridgeOptions interface
windowLocale function

The window's locale, a BCP 47 tag such as "de", which the application set for this window (IRunicWindowLocale in .NET), or null while it sets none and the page keeps its own (a producer of 0.16 or later, translation-text/1).

@runic-artifex/views/bindings

checkKeepAlive function

Checks a keepAlive option: a whole number of milliseconds from 0 to 2147483647, where 0 releases a client at once.

defaultKeepAlive constant

The grace period, in milliseconds, of a binding without a keepAlive option.

describeViewClient function

The View of a connected client, for a binding's DevTools labels: its view model, route and revision.

isViewClient function

True for a connected client; false for a connector.

missingViewMessage function

The developer-facing text for a reference kind without a registered web component.

reportMissingView function

Reports a reference kind without a registered web component through the page's error reporting (installErrorReporting, onBridgeDiagnostic, the console) after the current task, once per kind and page.

translationsTextRevision function

The revision of the Runic Translations text channel, which changes with each message the Translations Vite plugin updates in place during development, for framework bindings whose text locale snapshot must change then (useTextLocale). 0 without the channel, and always in the production build, which has none.

ViewDescription interface

A connected View client as the development tools describe it.

viewSourceIdentity function

The identity a binding compares to decide whether a source changed: the client itself or the connect function.

viewSourcePreview function

What a binding shows for a source before its controller follows it, as in the render before an effect: an observed client and its state, or the client and state that a released controller kept for the connector.

@runic-artifex/views/experimental

connectComponentBridge function

Connects a component to its guest with the endpoint that the host page received for it (hosted-region-content with the embedding component).

defineHostedRegion function

Defines <runic-hosted-region> in the page's custom element registry, once: a later call, also of another copy of this package, does nothing.

defineRunicComponent function

Defines the custom element of a component and returns its definition.

HostedRegionSizing type alias

How the region's height is set: fill, by the page's own layout (the default), or content-height, by the guest.

HostedRegionState type alias

What a hosted region shows, reflected in its state attribute: - waiting: no Window shows in the region yet, or the page is not connected to its host yet; - loading: the region's frame loads the guest's page; - attached: the frame shows the guest's page; - detached: the guest's Window is detached from the region and may come back, as after a lost connection; - ended: the guest's Window closed or its application went away; - unsupported: the host does not implement hosted regions, the region's name is invalid, or the host pushed an embedding this page does not know.

HostedRegionStateChangeDetail interface

The detail of runicregionstatechange.

hostedRegionTag constant

The tag of the element.

HostedRegionTitleChangeDetail interface

The detail of runicregiontitlechange: the guest page's title, or null when it has none.

RunicComponentBridge interface

The Bridge of a component: a RunicBridgeClient that the element closes when it ends.

RunicComponentConnection type alias

What an element connects with: a Bridge, or the endpoint that RunicComponentOptions turns into one.

RunicComponentContext interface

What a component's mount function gets for one element.

RunicComponentDefinition interface

A defined component.

RunicComponentElement interface

An element of a component.

RunicComponentEndpoint interface

Where a component's Bridge connects: the guest's surface and the component token (region-component/1).

RunicComponentMount type alias

Renders the guest's Views into context.container within context.instance, and returns a function that removes them.

RunicComponentOptions interface

Options of defineRunicComponent.

RunicComponentStyle interface

A stylesheet of the bundle: its text and the address that its relative url() references resolve against.

RunicHostedRegionElement interface

<runic-hosted-region name="check">: a region where the host application shows a guest's Window.

@runic-artifex/views/generated

BridgeCollectionDefinition interface

Generated row codec and key of a keyed collection, or an append-only text field (defineText).

BridgeCollections interface

The keyed collections and text fields of one generated client, passed to connectView as collections.

BridgeFieldWriteRequest interface

A checked write's request members, with the values already encoded as the field's wire type.

BridgeInteractions type alias

The interactions of one generated client, passed to connectView as interactions.

BridgeMemberDecoders type alias

One decoder per state member, by wire name: it validates the member's wire value and returns the client value, and throws for an invalid one.

BridgeOperationCodec interface

How generated code decodes the values of one operation.

BridgeOperationRuntimeHandle type alias

What the runtime returns for a started or recovered operation: either handle shape.

bridgeOperations constant
BridgeOperations interface

The operation protocol, passed to connectView as operations by a generated client with operations.

BridgeViewRequestHandler type alias

Handles one view request of a View: a one-way presentation action the ViewModel raised, such as focusing a field or showing a toast.

BridgeViewRequests type alias

The view requests of one generated client, passed to connectView as requests.

connectView function

Connects one generated client presentation to its route: sends open with a new presentation id and returns the connection once the state arrived.

decodeBridgeValidation function

Decodes the validation state of a ViewModel with validation.

decodeQueryCollectionState function

Decodes a query collection's state member.

defineCollection function

Keeps collection codecs typed in generated clients.

defineCollections function

Binds the collection codecs of a generated client to the code that applies their changes.

defineInteractions function

Binds the interaction codecs of a generated client to the interaction protocol.

defineQueryCollection function

Describes a query collection's rows for connectView.

defineRequests function

Binds the view request decoders of a generated client to the view request protocol.

defineText function

An append-only text field, such as a C# [RunicAppendOnlyText] string: its frames drop characters from its start and append text, instead of resending it.

disposable function

Defines [Symbol.dispose]() as value.dispose() where the engine has Symbol.dispose.

fieldErrors function

The validation messages of the member name (generated code calls it for BridgeField.errors): the member's own messages, own (its {name}Errors) when the View has them and none of the validation messages at [name] has a text reference, and otherwise the validation messages at [name], followed by the validation messages whose path continues below [name], in validation order.

fieldErrorsAt function

The validation messages of the value at a validation path and below it, in validation order, such as ["lines", 2, "quantity"] for a cell of the third row (generated code calls it for a field path's errors).

fieldPath function

A descriptor of one field path.

FieldPathClient interface

What a generated client with field paths offers their descriptors.

FieldPathSpec interface

How generated code describes one field path.

fieldValidating function

Whether the validation of the member name, or of a value below it, is in progress in validation (generated code calls it for BridgeField.validating): a validation.pending path starts with [name].

fieldValidatingAt function

Whether the validation of the value at a validation path, or of a value below it, is in progress: a validation.pending path starts with path (validation-pending/1).

InteractionDefinition interface

Generated codec and contract of one interaction.

InteractionScope interface

The presentation one set of interaction handlers belongs to.

InteractionSession interface

The interaction handlers of one open presentation.

OperationScope interface

The connection an operation starts on.

QueryCollectionDefinition interface

How a generated client decodes a query collection's rows, and the factory of its collections, which the generated client passes in so a View without query collections does not bundle them.

regionCollection function

Decodes a region collection member; content decodes one region's non-null content reference.

rowFields function

Generated code: the cells of a keyed collection, created per row key on first use.

rowIndex function

The index of the row with key in rows, or -1.

upload function

Uploads a file to the .NET host of the current instance (the page's window, outside RunicInstance.run) and resolves with its reference, which a command whose .NET parameter is a RunicUpload takes.

ViewConnection interface

The runtime half of a generated client: one presentation of a route, registered with open.

ViewConnectOptions interface

How a generated module connects one View route.

viewReferences function

Returns a per-module cache of content references.

ViewRequestDefinition interface

Generated decoder and contract of one view request.

ViewRequestScope interface

The presentation one set of view request handlers belongs to.

ViewRequestSession interface

The view request handlers of one presentation.

@runic-artifex/views/generated/mock

MockMethodName type alias

A client method name a failure can target, such as save, startSave, setTitle or canSetViewport.

mockTypedView function

Registers a typed mock View.

MockTypedViewDefinition interface

The loose shape of a generated mock definition.

MockTypedViewSpec interface

What a generated mock{Name}() knows about its client.

@runic-artifex/views/generated/wire

array function

An array of T: each element decoded with decode.

bigint function
blob function

blob: {url, type, size, name}; size and name may be null.

blobRef function

upload: {id, name, type, size}.

boolean function
dateTime function

date-time: a local date and time, followed by nothing, Z (UTC) or an offset within ±14:00, as read.

decimal function

decimal: a decimal string with at most 28 fraction digits and 96 bits of digits; a negative zero loses its sign.

duration function

duration: an ISO 8601 duration [-]P[nD][T[nH][nM][n[.f]S]] within ±2^63 100-ns units; returns the normal form, such as P1DT12H for PT36H, which Temporal.Duration.from reads.

encodeBlob function

The wire form of a blob the page sends back, such as through a mock: its members as they are.

encodeBlobRef function

The wire form of an upload reference: {id, name, type, size}.

encodeUnion function

A union written to the wire: an object whose $case member names the case.

enumName function

enum: one of the names the contract defines, compared exactly; the name is returned as it is.

finiteNumber function

float64: any finite number; negative zero is returned as zero.

float32 function

float32: a number whose nearest single-precision value is finite; returns the shortest decimal that rounds to it.

int64String function

int64: an integer string within −2^63 … 2^63−1; returns the decimal digits, with -0 as 0.

integer function

An integer wire type (int8 … uint32): a number whose value is an integer within minimum … maximum.

isTextReference function

Whether a value has the shape of a TextReference, as the Translations readers check it: an integer version of at least 1 (a later one than the page's runtime reads still decodes, and shows its fallback text), string catalog and contractFingerprint, a nonempty key, an arguments object, and a string fallbackText when present, or null in version 1.

json function

Any JSON value, for a C# JsonElement or JsonNode: null, a boolean, a finite number, a string, an array or a plain object of such values.

localDate function

local-date: an RFC 3339 full-date from 0001-01-01 to 9999-12-31.

localTime function

local-time: hh:mm:ss with 0 to 7 fraction digits; returns the normal form without trailing zeros.

object function
offsetDateTime function

offset-date-time: a date-time with a required offset; a zero offset becomes Z.

string function
stringRecord function

A map of T: each member value decoded with decode, with any member name.

textReference function

A text-reference value of the shape isTextReference checks, of JSON values.

TextReference interface

A text reference of Runic Translations (the text-reference wire type, values.md): a catalog, a message key, typed arguments and an optional fallback text, as the Translations transport writes it.

union function

A union: an object whose $case member names the case.

uuid function

uuid: 8-4-4-4-12 hexadecimal digits in either case; returns the lowercase normal form.

@runic-artifex/views/mock

createMockBridge function
installMockBridge function

Installs a mock as window.__runicBridge, so generated clients connect to it instead of waiting for a .NET host.

installMockMenuBar function

Serves the in-page menu bar (menu bar page protocol 2) with menus on a mock Bridge, for tests of a page's menu bar.

MockAvailability type alias

Whether a command is available for a wire input (can, and the check before the command runs).

mockBlob function

A RunicBlob for a mock's state or a command result, as .NET's RunicBlob arrives on the page.

MockBlobOptions interface

Options of mockBlob.

MockBridge interface

An in-memory __runicBridge: a Views protocol 4 producer for generated clients without .NET.

MockBridgeOptions interface
MockCall interface

One request the client sent, in order.

MockCollection interface

Edits one keyed collection of a mock View and pushes each edit as a frame with indexed changes, like a producer's keyed collection.

MockCollectionChange interface

One keyed collection change of a frame (specs/application/state-changes.md).

MockCommand type alias

Runs a command with its wire input (undefined for a command without input) and returns the state changes it makes.

MockCommandHandler type alias

Runs a command and returns the state changes it makes.

MockDomainFailure interface

A declared failure (domain-failed) the mock answers instead of running a handler.

MockErrorFailure interface

An unexpected failure the mock answers instead of running a handler.

mockFailure function

An error that a mock command or operation handler throws to fail with its declared failure: throw mockFailure({ $case: "titleRequired" }).

MockFailure type alias

A failure the mock answers instead of running a handler.

MockFailureOf type alias

The declared failure type of a client method: F for a command that resolves BridgeOutcome<_, F> or a start{Command} whose operation declares F.

MockInteractionOptions interface
MockInteractionReply type alias

How the browser answered an interaction request.

MockInterceptor type alias

Answers a request before the mock does: return a reply object to answer it (as { ok: true, … } or { ok: false, error }), or undefined to let the mock answer.

MockLatency type alias

How long each request, reply and push travels: a number of milliseconds, a range { min, max } from which each message draws its own delay, or "slow" (30 to 120 ms), which makes key-by-key typing race its echoes.

MockMenuBar interface

The host side of a mock in-page menu bar.

MockMenuBarOptions interface

Options of installMockMenuBar.

MockNavigation interface

The window's navigation in a mock (navigation-path/1).

MockNavigationRequest type alias

A navigation request (navigation-path/1): the window's Back, or a route path to open.

MockNavigationResult interface

The answer to a MockNavigationRequest: the outcome (null when no route matched) and the path after it.

MockOperation interface

An operation a client started with start{Command}().

MockOperationHandler type alias

Runs a started operation with its wire input.

MockOperationKind type alias

An operation's status kind, as the protocol names it.

MockOperationOutcome interface

What an operation handler's completion means.

MockQueryCollection interface

A query collection of a mock View, from view.query(member).

MockQueryLoad interface

One query-rows request the mock served.

MockQuerySource interface

The rows of a mock query collection, in wire form, and how the mock serves them.

MockReference interface

The wire form of a content reference in a mock state, such as { kind: "editor", id: "1" }.

MockRegionCollection interface

A region collection in a mock state (region-collections/1): each region's content as a MockReference.

MockRegionDecision interface

What a region collection decides about a request: its outcome (Committed by default) and more state changes.

MockRegionDefinition interface

A region collection of a mock View (region-collections/1).

MockRegionHandler type alias

Decides a region request of a mock region collection, standing in for its departure guards.

MockRegionRequest interface

A page's request to select or close the region with key; index is its position in the collection.

MockRegionResult interface

What a region handler decides: the request's outcome (Committed by default) and more state changes.

MockRequestMatch interface

Which requests failNext answers: a request kind of a route, optionally of one member.

MockScheduling type alias

When the mock delivers replies and pushes.

MockSetter type alias

Runs before a set applies value (a wire value) to its member.

MockSetterHandler type alias

Runs before a setter or checked write applies value.

MockState type alias

A View's wire state: one member per state member, by wire name, encoded as on the wire.

MockTypedCollection interface

A keyed collection of a typed mock.

MockTypedInteraction interface

An interaction that the producer asks the browser to handle.

MockTypedOperation interface

An operation that a client started with start{Command}(), with typed input and results.

MockTypedOperationHandler type alias

Runs a started operation.

MockTypedOperationOutcome interface
MockTypedQueryCollection interface

A query collection of a typed mock: its rows, and the loads the page asked for.

MockTypedQuerySource interface

The rows a typed mock serves for a query collection (query-collections/1).

MockTypedView interface

The typed mock of one generated client, created by a generated mock{Name}().

MockTypedViewRequest interface

A view request (view-requests/1) that the ViewModel raises for the browser to handle.

MockUpload interface

An upload the mock received (blobs/1).

MockUploadFailure interface

How the mock answers the next upload instead of storing it (MockBridge).

MockView interface
MockViewDefinition interface
releaseKeptViews function

Releases at once the clients that framework bindings (useView, injectView, createViewController, preloadView) keep for their keepAlive period in the current instance (the page's, or that of the RunicInstance.run it is called in), and returns how many it released.