roots/runtime API
Every export of roots/runtime in Roots 0.4.0, read from runtime/core/index.lisp when this page was built: the declaration, the docstring and the file that defines it. Declarations are TypeScript, printed by the compiler that builds the runtime. A member of a class or of an object has an entry of its own (router.push(), theme.set()). The guides explain how the pieces work together.
Explained in context: the roots/runtime chapter, Components, Templates and components.
Functions #
append #
function append(parent: unknown, ...children: unknown[]): unknownAppend CHILDREN (host nodes, Blocks, strings) to the host node PARENT. Returns PARENT.
Defined in runtime/core/index.lisp.
batch #
function batch<R>(fn: () => R): RRun FN; effects triggered by its writes run once, after it returns.
Defined in runtime/reactivity.lisp.
bindAttr #
function bindAttr(node: unknown, name: string, getter: () => unknown, over?: boolean): voidA reactive prop/attribute (class/style values are normalized and merged). A first value that means "absent" is not written (ABSENT-PROP-P) unless NODE may hold NAME already: OVER says so (a static attribute or an object spread written to NODE before this call), and so does a component as NODE (its root element comes configured).
Defined in runtime/core/index.lisp.
bindClass #
function bindClass(target: unknown, staticClass: unknown, getter: () => unknown): voidStatic and dynamic classes merged (string | array | { name: condition }).
Defined in runtime/core/index.lisp.
bindClassEl #
function bindClassEl(node: unknown, getter: () => unknown): voidBIND-CLASS for NODE, an element without a static class beside the bound one (a static class of a template element that also has :class is not in the spec: such a node gets BIND-CLASS).
Defined in runtime/core/index.lisp.
bindElText #
function bindElText(node: unknown, getter: () => unknown): voidBIND-TEXT for NODE, the element an interpolation is the only child of.
Defined in runtime/core/index.lisp.
bindSelected #
function bindSelected(
node: unknown,
selector: unknown,
key: unknown,
apply: (a: boolean) => unknown,
): booleanKeep the class of NODE (an element of a static template without a static class, see BIND-CLASS-EL) equal to normalizeClass(APPLY(SELECTOR(KEY))) without an effect, and return true. For SELECTOR a function createSelector returned and APPLY a pure function of its argument (true: KEY is selected). False, and nothing done, when SELECTOR is anything else or no scope is active: the caller then binds the class ($.bindSelected(n, sel, key, apply) || $.bindClassEl(n, () => apply(sel(key)))). KEY must not change while NODE lives (the key of the keyed v-for item NODE is in). The class is written in the render flush, in the place a class binding made here would have.
Defined in runtime/core/index.lisp.
bindStyle #
function bindStyle(target: unknown, staticStyle: unknown, getter: () => unknown): voidStatic and dynamic styles merged (string | array | object); the dynamic part wins.
Defined in runtime/core/index.lisp.
bindText #
function bindText(node: unknown, getter: () => unknown): voidKeep the existing text node NODE equal to toDisplayString(GETTER()) (a template's interpolation). NODE may be the element an interpolation is the only child of (CLONE collects the element in its place): the text is then the element's text content.
Defined in runtime/core/index.lisp.
clone #
function clone(tpl: Template): any[]A fresh copy of TPL; returns its collected nodes in document order (the root first). Copied from a prototype on a backend with cloneNode, firstChild and isElement (or in a build that promises one, CLONE-BACKEND; its adopt, when it has one, then gets the collected Box and Spacer nodes of the copy: TPL's ADOPT); built with the helpers otherwise (then the root is registered: it may become a component's root element, which attrs fall through onto).
Defined in runtime/core/index.lisp.
component #
function component(comp: unknown, props?: RawProps | null, slots?: Slots | null): BlockCreate a child component (CONTRACT §3). PROPS: { name: value | getter }, where any function is a getter except for onX handlers. SLOTS: { name: (slotProps) => content }.
Defined in runtime/core/index.lisp.
computed #
function computed<T>(a: () => T): ReadonlyRef<T>
function computed<T>(a: WritableComputedOptions<T>): Ref<T>A lazy, cached derived value. Recomputes only when a source actually changed.
Defined in runtime/reactivity.lisp.
createApp #
function createApp(root: unknown, rootProps?: RawProps): AppAn app for the root component ROOT (CONTRACT §3).
Defined in runtime/core/index.lisp.
createSelector #
function createSelector<T>(source: Ref<T> | ReadonlyRef<T> | (() => T)): (key: T) => booleanWhich key is selected, with O(1) updates. Returns IS-SELECTED: (IS-SELECTED KEY) is true when KEY is SOURCE's value (a ref, a computed or a getter; compared with Object.is). An effect or a binding that calls it depends on its key only: when the value moves from A to B, only the readers of A and B run again, not every reader (the selected row of a list). A computed without subscribers depends on SOURCE itself. The selector watches SOURCE from the current scope and stops with it. Besides the readers' deps (KEYS), a selector keeps the targets bound to its keys with SELECTOR-BIND (TARGETS, made by the first one: a key's one target as it is, a list from the second on), and tells them the same moves.
Defined in runtime/reactivity.lisp.
defineComponent #
function defineComponent<T extends ComponentOptions>(options: T | ((a: any, b: SetupContext) => unknown)): TIdentity for component options (typed); a function becomes { setup }.
Defined in runtime/core/index.lisp.
dynamicComponent #
function dynamicComponent(getter: () => unknown, props?: RawProps, slots?: Slots): Block<component :is>: GETTER() returns a component, a registered name, or a tag name.
Defined in runtime/core/index.lisp.
dynamicText #
function dynamicText(getter: () => unknown): unknownA text node kept equal to toDisplayString(GETTER()).
Defined in runtime/core/index.lisp.
effect #
function effect(
fn: (onCleanup: OnCleanup) => void,
options?: EffectOptions | undefined,
): EffectHandleRun FN now and again whenever a value it read changes (after the current update). FN receives ON-CLEANUP to register cleanup functions for the next run / stop. OPTIONS.scheduler, when given, is called instead of queuing a re-run; OPTIONS.cleanup "run" declares that FN uses ON-CLEANUP during its run at most, and neither inside untrack nor inside a computed or a watch getter (see EffectOptions; elsewhere it is R106).
Defined in runtime/reactivity.lisp.
effectScope #
function effectScope(detached?: boolean): EffectScopeDefined in runtime/reactivity.lisp.
element #
function element(tag: string): unknownA host node for TAG: a host primitive (Box, Text, Button, Input, Checkbox, Image, Link, Spacer) or a plain lowercase tag, created by the active backend.
Defined in runtime/core/index.lisp.
flushJobs #
function flushJobs(): voidRun queued watcher callbacks now (pre, then post). Normally scheduled in a microtask.
Defined in runtime/reactivity.lisp.
forBlock #
function forBlock(
source: () => unknown,
renderItem: (...rest: any[]) => unknown,
key?: ((a: any, b: any, c: any) => unknown) | undefined,
single?: boolean,
): Blockv-for: SOURCE() returns an array, a number (1..n), a string, an iterable or an object. RENDER-ITEM receives (item, index) — for objects (value, key, index) — each an object whose .value is tracked. KEY(item, index) gives each item's identity; without it items are matched by position. SINGLE (true, from the template compiler): RENDER-ITEM returns exactly one host element, which the list inserts as it is. The list gets an owner of its own (one, not one per item): its items' records are the scopes of their effects, and the owner carries them in the tree of owners (they unmount with it).
Defined in runtime/core/index.lisp.
fragment #
function fragment(...children: unknown[]): BlockA Block of several children (multi-root templates).
Defined in runtime/core/index.lisp.
getCurrentInstance #
function getCurrentInstance(): ComponentInstance | nullThe component whose setup or render is running (internal API for libraries), or null.
Defined in runtime/core/index.lisp.
getCurrentScope #
function getCurrentScope(): Scope | nullThe scope effects made now belong to: an EffectScope, or, inside a list item's render, the item itself (a Scope: onScopeDispose works, run/stop are the item's).
Defined in runtime/reactivity.lisp.
ifBlock #
function ifBlock(
condition: () => unknown,
renderThen: () => unknown,
renderElse?: (() => unknown) | undefined,
): Blockv-if / v-else: renders RENDER-THEN while CONDITION() is truthy, else RENDER-ELSE. v-else-if chains nest: the else render returns another ifBlock.
Defined in runtime/core/index.lisp.
inject #
function inject(key: PropertyKey, defaultValue?: unknown, factory?: boolean): anyThe value provided for KEY by the nearest ancestor (or the app). DEFAULT-VALUE when none (called when FACTORY is true); warns R206 when there is neither.
Defined in runtime/core/index.lisp.
insert #
function insert(parent: unknown, child: unknown, before: unknown): unknownInsert CHILD (a host node, Block or string) into PARENT before the host node BEFORE. Returns PARENT.
Defined in runtime/core/index.lisp.
isReactive #
function isReactive(x: unknown): booleanDefined in runtime/reactivity.lisp.
isRef #
function isRef(x: unknown): x is Ref<unknown>Defined in runtime/reactivity.lisp.
markRaw #
function markRaw<T extends object>(value: T): TNever make VALUE reactive (e.g. class instances from libraries, DOM nodes).
Defined in runtime/reactivity.lisp.
model #
function model(
node: unknown,
getter: () => unknown,
setter: (a: any) => unknown,
modifiers?: unknown,
): voidv-model on Input/input/textarea (value + input), Checkbox / checkbox (checked + change; an array model toggles the input's value), radio and select (value + change). Modifiers: trim, number, lazy.
Defined in runtime/core/index.lisp.
nextTick #
function nextTick(fn?: (() => unknown) | undefined): Promise<void>A promise for the moment pending updates (render effects, watchers) have been applied.
Defined in runtime/core/index.lisp.
normalizeClass #
function normalizeClass(value: unknown): stringClass binding → class string: strings, arrays and { name: condition } objects (Vue rules).
Defined in runtime/core/index.lisp.
normalizeStyle #
function normalizeStyle(value: unknown): StyleObjectStyle binding → { kebab-case-property: string } (strings "a: b; c: d", objects, arrays).
Defined in runtime/core/index.lisp.
on #
function on(
target: unknown,
event: string,
handler: (a: any) => unknown,
modifiers?: unknown,
): voidListen to EVENT on TARGET (a host node, or a component: its root element). With MODIFIERS it is ON-WITH: the template compiler calls that one itself, so that an app without an event modifier does not carry their code; a render function written by hand may pass them here.
Defined in runtime/core/index.lisp.
onBeforeUnmount #
function onBeforeUnmount(hook: Hook): voidRun HOOK before the component's nodes are removed (parents before children).
Defined in runtime/core/index.lisp.
onEl #
function onEl(node: unknown, event: string, handler: (a: any) => unknown): voidON for NODE, an element of a static template (lean, see SET-EL-TEXT): through the backend's listenElement where it has one.
Defined in runtime/core/index.lisp.
onErrorCaptured #
function onErrorCaptured(hook: ErrorCapturedHook): voidHOOK(error, instance, info) sees errors of descendant components; returning false stops propagation.
Defined in runtime/core/index.lisp.
onMounted #
function onMounted(hook: Hook): voidRun HOOK once the component's nodes are in the live tree (children before parents).
Defined in runtime/core/index.lisp.
onRow #
function onRow(node: unknown, event: string, handler: RowHandler, row: unknown): voidListen to EVENT on NODE, an element of a static template in a list item (lean, see SET-EL-TEXT), with the ROW-HANDLER HANDLER: it is called with ROW (what the item function got as its item) and the event.
Defined in runtime/core/index.lisp.
onScopeDispose #
function onScopeDispose(fn: Cleanup): voidDefined in runtime/reactivity.lisp.
onUnmounted #
function onUnmounted(hook: Hook): voidRun HOOK after the component was removed and its effects stopped (children before parents).
Defined in runtime/core/index.lisp.
onWith #
function onWith(
target: unknown,
event: string,
handler: (a: any) => unknown,
modifiers: unknown,
): voidON with MODIFIERS (array or object): stop prevent self once, ctrl shift alt meta exact, mouse left middle right, and key filters for key* events (enter esc space up down left right tab delete, or any hyphenated key name).
Defined in runtime/core/index.lisp.
portal #
function portal(render: () => unknown, target?: unknown): BlockRender RENDER's content in an overlay layer instead of in place (dialogs, menus, toasts). The layer is TARGET (a host node, or a function of the portal's anchor returning one or null), else backend.layer(anchor); on a backend without layers the content renders in place. The content belongs to the current owner: it updates and unmounts with it. Only an invisible anchor stays in place, so moving the portal (v-for) never moves the overlay.
Defined in runtime/core/index.lisp.
provide #
function provide(key: PropertyKey, value: unknown): voidMake VALUE available to descendants via inject(KEY).
Defined in runtime/core/index.lisp.
reactive #
function reactive<T extends object>(target: T): TA deeply reactive proxy of a plain object or array. Prefer REF for single values.
Defined in runtime/reactivity.lisp.
readonly #
function readonly<T extends object>(target: T): Readonly<T>A deeply readonly view: reads track, writes throw R103.
Defined in runtime/reactivity.lisp.
ref #
function ref<T>(value: T): Ref<T>A reactive value container: read and write .value. Objects become deeply reactive.
Defined in runtime/reactivity.lisp.
resolveComponent #
function resolveComponent(ctx: any, name: string): unknownA component registered by NAME (component's own components, then app.component()); R201 if unknown.
Defined in runtime/core/index.lisp.
rowHandler #
function rowHandler(fn: (a: any, b: any) => unknown): RowHandlerA handler for the items of a list: FN(row, event), to be attached with ON-ROW. Made once per render of the list, in the component whose template the handler is written in.
Defined in runtime/core/index.lisp.
runtimeWarn #
function runtimeWarn(
code: string,
message: string,
instance?: ComponentInstance | null | undefined,
): voidA recoverable problem: goes to app.config.warnHandler, else console.warn. Exported for libraries (the UI kit's R6xx warnings), so they reach the same handler with a component trace.
Defined in runtime/core/index.lisp.
setAttr #
function setAttr(node: unknown, name: string, value: unknown): voidA static prop/attribute: class string, style string/object, id, disabled, value...
Defined in runtime/core/index.lisp.
setElText #
function setElText(node: unknown, value: unknown): booleanSET-TEXT for NODE, the element an interpolation is the only child of: VALUE becomes its text content once (nothing for an empty text) and true is returned; false, and nothing written, for an object (see SET-TEXT).
Defined in runtime/core/index.lisp.
setText #
function setText(node: unknown, value: unknown): booleanWrite toDisplayString(VALUE) into NODE once and return true: a template interpolation whose value cannot change while its node lives (it shows the key of the keyed v-for it is in, CONTRACT §3), so no render effect is made. An object as VALUE is not such a value (its text, JSON, reads state that can change under the same key): nothing is written and false is returned, for the caller to bind the text ($.setText(n, v) || $.bindText(n, () => v)). NODE is the interpolation's text node, or the element it is the only child of (CLONE collects the element in its place): the text then becomes the element's text content (setTextContent, which lets the DOM make the text node; createText + insert on other backends), and an empty text writes nothing, as BIND-TEXT's first run.
Defined in runtime/core/index.lisp.
shallowRef #
function shallowRef<T>(value: T): Ref<T>Like REF, but only .value assignment is tracked; the value itself is not made reactive.
Defined in runtime/reactivity.lisp.
show #
function show(target: unknown, getter: () => unknown): voidv-show: display: none while GETTER() is falsy.
Defined in runtime/core/index.lisp.
slot #
function slot(
ctx: any,
name: string,
props?: { [key: string]: unknown } | undefined | null,
fallback?: (() => unknown) | undefined,
): unknown<slot> outlet: the parent's slot NAME called with props (PROPS: { name: getter }), or FALLBACK.
Defined in runtime/core/index.lisp.
template #
function template(spec: any[]): TemplateA static template for CLONE (the template compiler hoists these to module level).
Defined in runtime/core/index.lisp.
templateRef #
function templateRef(
node: unknown,
ctx: any,
name: string | ((a: unknown) => unknown),
): voidref="name": sets the setup ref NAME (or calls a function ref) to the host node, or to the exposed object / _ctx of a component. An array ref collects (v-for). Reset on unmount.
Defined in runtime/core/index.lisp.
text #
function text(value: unknown): unknownA static text node.
Defined in runtime/core/index.lisp.
toDisplayString #
function toDisplayString(value: unknown): stringText for an interpolation: null/undefined → "", arrays and plain objects → JSON, refs unwrapped.
Defined in runtime/core/index.lisp.
toRaw #
function toRaw<T>(value: T): TThe original object behind a reactive proxy (or the value itself).
Defined in runtime/reactivity.lisp.
toRef #
function toRef<T extends object, K extends keyof T>(object: T, key: K): Ref<T[K]>A ref bound to OBJECT[KEY]: reading and writing go through the reactive object.
Defined in runtime/reactivity.lisp.
toRefs #
function toRefs<T extends object>(object: T): { [K in keyof T]: Ref<T[K]> }Convert each property of a reactive object to a ref, so it can be destructured safely.
Defined in runtime/reactivity.lisp.
toValue #
function toValue<T>(source: T | Ref<T> | ReadonlyRef<T> | (() => T)): TNormalize a value, ref or getter to its current value.
Defined in runtime/reactivity.lisp.
transaction #
function transaction<R>(fn: () => R): RLike BATCH, but atomic: if FN throws, every write it made is rolled back and the error is rethrown. No effect ever observes a partial transaction.
Defined in runtime/reactivity.lisp.
unref #
function unref<T>(x: T | Ref<T> | ReadonlyRef<T>): TDefined in runtime/reactivity.lisp.
untrack #
function untrack<R>(fn: () => R): RRun FN without recording dependencies.
Defined in runtime/reactivity.lisp.
useAttrs #
function useAttrs(): anyDefined in runtime/core/index.lisp.
useSlots #
function useSlots(): SlotsDefined in runtime/core/index.lisp.
watch #
function watch<T>(
source: WatchSource<T> | T,
callback: (a: T, b: T | undefined, c: OnCleanup) => unknown,
options?: { immediate?: boolean; deep?: boolean; once?: boolean; flush?: "sync" | "pre" | "post" },
): () => voidreactivity watch() whose callback errors go to the component's error handlers. Watching a component's props object watches every prop (deep).
Defaults: immediate false, deep false, once false, flush "pre".
Defined in runtime/core/index.lisp.
watchEffect #
function watchEffect(
fn: (a: OnCleanup) => unknown,
options?: { flush?: "sync" | "pre" | "post" },
): () => voidreactivity watchEffect() whose errors go to the component's error handlers.
Defaults: flush "pre".
Defined in runtime/core/index.lisp.
Constants #
CLONE_BACKEND #
const CLONE_BACKEND: booleanA build's promise that every backend of the app copies static templates (cloneNode, firstChild, isElement): CLONE then does not ask the backend, and a bundler that defines this binding true (roots build does on the DOM targets) drops the code that builds a template node by node. False (the value outside such a build): the backend is asked each time. Never written.
Defined in runtime/core/index.lisp.
DEV #
const DEV: booleanDevelopment checks that cost time: R215 (duplicate keys) on pure insertions scans every key of the list and a swap's two keys are checked against the kept items; INSERT refuses an anchor that is its own parent (R224); a component's props are validated when it is created (the R202 and R203 warnings: every declared prop is read once). True unless the global __ROOTS_DEV__ says otherwise: Roots' production build (roots build) defines DEV false in the bundle, and a bundler define of __ROOTS_DEV__ folds this initializer too. The checks the reconciliation gets for free stay.
Defined in runtime/core/index.lisp.
Types #
App #
class App {
mount(backend: AnyBackend, target: unknown, options?: object | undefined): any;
unmount(): void;
component(name: string, comp?: unknown): any;
provide(key: PropertyKey, value: unknown): this;
use(plugin: unknown, ...options: any[]): this;
onUnmount(fn: () => void): void;
}Returned by createApp(): mount it on a backend, register components and plugins.
app.mount() #
mount(backend: AnyBackend, target: unknown, options?: object | undefined): anyRender the root component with BACKEND into TARGET (DOM: selector or element; terminal: { stdout, stdin, columns, rows }). Returns the root's public instance.
app.unmount() #
unmount(): voidUnmount the app: beforeUnmount hooks, remove its nodes, stop every effect, unmounted hooks.
app.component() #
component(name: string, comp?: unknown): anyRegister COMP globally under NAME (returns the app), or look NAME up.
app.provide() #
provide(key: PropertyKey, value: unknown): thisProvide VALUE to every component of the app.
app.use() #
use(plugin: unknown, ...options: any[]): thisInstall a plugin once: plugin.install(app, ...options), or plugin(app, ...options).
app.onUnmount() #
onUnmount(fn: () => void): voidRun FN when the app is unmounted (plugins clean up here).
Defined in runtime/core/index.lisp.
AppConfig #
interface AppConfig {
errorHandler: ((a: unknown, b: any, c: string) => void) | null;
warnHandler: ((a: string, b: any, c: string) => void) | null;
globalProperties: { [key: string]: unknown };
navigator: Navigator | null;
}Defined in runtime/core/index.lisp.
Backend #
interface Backend<N> {
readonly name: string;
createElement(tag: string): N;
createText(text: string): N;
setText(node: N, text: string): void;
createAnchor(): N;
insert(parent: N, child: N, anchor: N | null): void;
remove(child: N): void;
parentNode(node: N): N | null;
nextSibling(node: N): N | null;
setProp(node: N, key: string, value: unknown): void;
addEvent(node: N, event: string, handler: (a: any) => void): () => void;
mount(root: N, target: unknown, options?: object): MountHandle;
isElement?(node: N): boolean;
cloneNode?(node: N): N;
firstChild?(node: N): N | null;
collect?(ops: number[], root: N, out: unknown[]): void;
adopt?(node: N, tag: string): void;
setTextContent?(node: N, text: string): void;
listen?(node: N, event: string, handler: (a: any) => unknown, data: unknown, invoke: (a: (a: any) => unknown, b: unknown, c: any) => void): void;
home?(proto: N): void;
listenElement?(node: N, event: string, handler: unknown, data: unknown, invoke: ((a: (a: any) => unknown, b: unknown, c: any) => void) | undefined): void;
clear?(parent: N): void;
layer?(node: N): N | null;
}A renderer (CONTRACT §5). The runtime creates and updates host nodes only through it. insert must move a node that is already attached (DOM insertBefore semantics).
Defined in runtime/core/index.lisp.
Block #
class Block {
}A range of host nodes: a fragment, a component, or dynamic content (if/for/slot...). NODES are host nodes or nested Blocks, in order. Dynamic blocks have an ANCHOR, an invisible node placed after their content; updates insert new content before it. A keyed list's block has LIST, and its nodes are those of the list's records (NODES stays empty: the records are the one place the list keeps its items).
Defined in runtime/core/index.lisp.
ComponentInstance #
class ComponentInstance {
readonly uid: number;
readonly type: ComponentOptions;
}A mounted component (internal; templates see its _ctx proxy). What most components never use is made on first use and null until then: the four hook lists (ADD-HOOK), REFS (template refs, $refs) and DEFAULT-CACHE (factory defaults). ATTR-KEYS is null and ATTRS the one view all such components share (EMPTY-ATTRS) when no attr was passed; ATTR-CACHE holds the computeds of the attr getters that were read. PROPS, ATTRS and CTX are Proxies over a small target each, with handlers shared by all components. PROP-GETTERS and PROP-VALUES are always there: READ-PROP asks them on every prop read.
componentInstance.uid #
readonly uid: numbercomponentInstance.type #
readonly type: ComponentOptionsDefined in runtime/core/index.lisp.
ComponentOptions #
interface ComponentOptions {
name?: string;
props?: string[] | { [key: string]: unknown };
emits?: string[] | { [key: string]: unknown };
components?: { [key: string]: unknown };
inheritAttrs?: boolean;
setup?(props: any, context: SetupContext): unknown;
render?(ctx: any): unknown;
}A component definition: what defineComponent takes and the template compiler emits (CONTRACT §2).
Defined in runtime/core/index.lisp.
EffectScope #
class EffectScope {
run<R>(fn: () => R): R | undefined;
onError(handler: (error: unknown) => void): this;
stop(): void;
}Owns the effects created while it runs; STOP disposes them all. Its lists are made on first use, and a scope with one effect holds it in EFFECTS itself (many scopes own one or two effects; a list item's live in its record, see Scope). Computeds are not owned: one leaves its sources' subscriber lists with its last subscriber (DISCONNECT), so the scope's effects stopping is enough, and a computed that something outside the scope still reads stays alive.
effectScope.run() #
run<R>(fn: () => R): R | undefinedeffectScope.onError() #
onError(handler: (error: unknown) => void): thisHandle errors thrown by effects in this scope (and child scopes without a handler).
effectScope.stop() #
stop(): voidDefined in runtime/reactivity.lisp.
ErrorCapturedHook #
type ErrorCapturedHook = (a: unknown, b: any, c: string) => unknown;Defined in runtime/core/index.lisp.
Hook #
type Hook = () => unknown;Defined in runtime/core/index.lisp.
MountHandle #
interface MountHandle {
unmount(): void;
}Defined in runtime/core/index.lisp.
Navigator #
interface Navigator {
href(to: unknown): string;
navigate(to: unknown, replace: boolean): void;
isActive(to: unknown, exact: boolean): boolean;
}Installed by the router (app.config.navigator): lets <Link to> navigate without a page load.
Defined in runtime/core/index.lisp.
OnCleanup #
type OnCleanup = (a: () => void) => void;Defined in runtime/core/index.lisp.
Plugin #
interface Plugin {
install(app: App, ...options: any[]): unknown;
}Defined in runtime/core/index.lisp.
RawProps #
type RawProps = { [key: string]: unknown };Defined in runtime/core/index.lisp.
ReadonlyRef #
interface ReadonlyRef<T> {
readonly value: T;
}Defined in runtime/reactivity.lisp.
Ref #
interface Ref<T> {
value: T;
}Defined in runtime/reactivity.lisp.
RootsError #
class RootsError extends Error {
readonly code: string;
}Extends Error: its members are members of this class too.
rootsError.code #
readonly code: stringDefined in runtime/reactivity.lisp.
RowHandler #
interface RowHandler {
fn: (a: any, b: any) => unknown;
inst: ComponentInstance | null;
invoke: (a: any, b: unknown, c: any) => void;
}A handler shared by the items of a list (ROW-HANDLER): FN(row, event), the component it was made in (INST, for errors), and the invoker a backend calls it through (CONTRACT §5 listenElement).
Defined in runtime/core/index.lisp.
SetupContext #
interface SetupContext {
emit: (a: string, ...rest: any[]) => void;
slots: Slots;
attrs: { [key: string]: unknown };
expose(exposed?: object): void;
}Defined in runtime/core/index.lisp.
SlotFn #
type SlotFn = (a?: any) => unknown;Defined in runtime/core/index.lisp.
Slots #
type Slots = { [name: string]: SlotFn | undefined };Defined in runtime/core/index.lisp.
StyleObject #
type StyleObject = { [key: string]: string };Defined in runtime/core/index.lisp.
Template #
class Template {
readonly spec: any[];
readonly walk: number[];
readonly count: number;
readonly adopt: any[] | null;
}A static template: SPEC, WALK, the moves that find the COUNT collected nodes in a copy (see WALK-PROGRAM), and its prototype per backend (one backend is the common case: its prototype is in a field; further backends get a map). ADOPT lists the collected nodes a backend's adopt is called for after copying (see ADOPTED-TAG-P): the position among the collected nodes and the tag of each, flat (index, tag, index, tag...); null when there are none, the usual case.
template.spec #
readonly spec: any[]template.walk #
readonly walk: number[]template.count #
readonly count: numbertemplate.adopt #
readonly adopt: any[] | nullDefined in runtime/core/index.lisp.
WatchSource #
type WatchSource<T> = Ref<T> | ReadonlyRef<T> | (() => T);Defined in runtime/core/index.lisp.