API reference
Find Valyrian.js modules and symbols by capability. Each entry provides its import, signature, result, errors and related guide.
Runtime and views
v- Creates the vnode description that Valyrian.js renders as part of a view.
mount- Starts a Valyrian.js application on a DOM target.
unmount- Ends the mounted application lifecycle.
update- Requests a render pass for the mounted view.
debouncedUpdate- Groups repeated update requests according to the timing behavior of the public API.
preventUpdate- Controls automatic rendering for delegated events.
onCreate- Runs when a component first enters the rendered tree and may return cleanup or a promise.
onUpdate- Runs after later patches while the component remains in the rendered tree and may return cleanup.
onCleanup- Runs before each patch of the vnode subtree and before that subtree detaches.
onRemove- Runs after the component subtree detaches from the rendered tree.
directive- Makes a named directive available to rendered nodes.
directives- Exposes the registered runtime directives by name.
trust- Marks an HTML string for direct rendering.
Vnode- Represents a virtual node with its tag, properties, children and lifecycle state.
createElement- Creates a DOM or SVG element for the requested tag.
current- Exposes the vnode, component and event currently processed by the runtime.
fragment- Identifies a fragment that groups children without adding a wrapper element.
hydrateDomToVnode- Builds a vnode representation from an existing DOM value.
isComponent- Returns true for a functional component or a POJO component with a view function.
isNodeJs- Reports whether Valyrian.js is running in a Node.js environment.
isPOJOComponent- Checks whether a value is a plain-object component with a view.
isVnode- Checks whether a value is a Valyrian.js vnode.
isVnodeComponent- Checks whether a value is a vnode whose tag is a component.
reservedProps- Exposes property names reserved by Valyrian.js.
setAttribute- Applies one property value to the DOM represented by a vnode.
setPropNameReserved- Marks a property name for special runtime handling.
updateAttributes- Reconciles the properties of a new vnode with its previous DOM state.
updateVnode- Updates the DOM rendered for a vnode and returns server output when produced.
Properties- Type. Open vnode and component properties.
DomElement- Type. DOM element shape used by rendered vnodes.
Component- Type. Callable functional component shape.
POJOComponent- Type. Object component with a view function.
ValyrianComponent- Type. Union of public component shapes.
VnodeComponentInterface- Type. Vnode tagged with a Valyrian component.
Children- Type. Children accepted by vnodes and components.
Directive- Type. Runtime directive callback.
Fragment- Type. Exported fragment sentinel.
VnodeTag- Type. Element, component or fragment vnode tag.
VnodeWithDom- Type. Element vnode with an attached DOM node.
v-create- Concept. Runs a callback after initial element creation.
v-update- Concept. Runs a callback after later element patches.
v-cleanup- Concept. Runs cleanup before patch or detach.
v-remove- Concept. Runs a callback after element detach.
v-if- Concept. Conditionally includes a vnode.
v-show- Concept. Toggles display while retaining the vnode.
v-for- Concept. Renders an iterable through a callback child.
v-html- Concept. Assigns direct HTML content.
v-text- Concept. Assigns direct text content.
v-class- Concept. Applies classes from a string, array or object.
v-model- Concept. Synchronizes a named control with object state.
v-keep- Concept. Skips subtree patches while its guard is unchanged.
key- Concept. Stable vnode identity for reconciliation.
Routing
Router- Coordinates route definitions and resolves navigation through the public router flow.
RouterError- Represents a router failure exposed for application-level handling.
mountRouter- Uses a Router as the mounted navigation root.
redirect- Starts navigation to the supplied URL and optionally avoids pushing browser history.
beforeRoute- Observes attempts to leave the current route.
afterRoute- Observes completed route changes.
Request- Type. Parsed Router request passed to middleware.
Middleware- Type. Router route and error handler.
v-route- Concept. Adds internal SPA navigation to an anchor.
Data and async
request- Provides the asynchronous Valyrian.js HTTP client entry point.
RequestPlugin- Type. Request lifecycle plugin hooks.
RequestContext- Type. Normalized request plugin input.
ResponseContext- Type. Successful response plugin input.
ErrorContext- Type. Rejected request plugin input.
RequestInterface- Type. Callable Request client with its published return contract.
Suspense- Renders fallback while asynchronous children resolve, then renders the result or error output.
Task- Coordinates concurrent asynchronous work.
TaskStatus- Type. Public Task lifecycle states.
TaskStrategy- Type. Scheduling strategy for overlapping Task runs.
TaskState- Type. Generic Task state snapshot.
TaskContext- Type. Abort context passed to a Task handler.
TaskOptions- Type. Task strategy and outcome callbacks.
TaskHandler- Type. Synchronous or asynchronous Task operation.
QueryClient- Creates query and mutation handles over a shared cache with invalidation and persistence controls.
QueryHandle- Exposes the public state and operations of a query.
MutationHandle- Exposes the public state and operations of a mutation.
QueryKey- Type. Serializable query cache identity.
QueryStatus- Type. Query and mutation lifecycle states.
QueryState- Type. Generic query or mutation state.
QueryConfig- Type. Query key, fetcher and freshness options.
MutationConfig- Type. Mutation executor and outcome callbacks.
QueryClientOptions- Type. Cache freshness, lifetime and persistence options.
QueryChangeEvent- Type. QueryClient cache and operation event.
Network and offline
NetworkManager- Observes browser connectivity and signal quality.
NetworkEvent- Enumerates the ONLINE, OFFLINE and CHANGE network events.
SignalLevel- Identifies the connection signal returned by NetworkManager from None through Excellent.
NetworkError- Represents a public network failure that the application can handle.
NetworkStatus- Type. Connectivity and signal metrics snapshot.
NetworkListener- Type. Connectivity event listener.
NetworkManagerRuntime- Type. Environment objects used by NetworkManager.
NetworkManagerOptions- Type. Network runtime adapters.
OfflineQueue- Stores operations, processes them when the network is available and exposes pending and failed counts plus syncing state.
RetryStrategy- Type. Offline retry delay strategy.
BackoffConfig- Type. Offline retry timing options.
OfflineOperation- Type. Persisted offline queue operation.
QueueState- Type. Offline queue counters and sync state.
OfflineQueueOptions- Type. OfflineQueue delivery and retry configuration.
State
createPulse- Creates one reactive value and returns `read()`, `write(...)` and `runSubscribers()`.
createPulseStore- Returns proxied state and named pulse methods that publish committed changes.
createMutableStore- Creates a mutable store with named pulse methods.
createEffect- Runs work in response to reactive dependencies.
Pulse- Type. Named pulse-store operation.
PulseContext- Type. Pulse method context with $flush().
FluxStore- Provides named mutations, asynchronous actions, computed getters, modules and plugins over Flux state.
Forms
FormStore- Coordinates form state, validation, transforms and submission.
formSchemaShield- Applies the schema validation path exposed for Valyrian.js forms.
FormState- Type. Base FormStore state record.
FormTransform- Type. Form field transform callback.
FormTransformMap- Type. Optional transforms by form field.
FormOptions- Type. FormStore state, schema, transforms and submit options.
v-form- Concept. Connects form submission to FormStore.
v-field- Concept. Binds a named control to FormStore.
DevTools
connectPulse- Bridges one pulse to Redux DevTools.
connectPulseStore- Bridges a pulse store to Redux DevTools.
connectFluxStore- Bridges a Flux store to Redux DevTools.
Utilities
getLang- Returns the active translation language.
getTranslations- Returns the configured translation dictionaries.
setLang- Selects which dictionary `t` resolves.
setLog- Enables or disables translation logging.
setStoreStrategy- Configures how the translation module reads and persists the active language.
setTranslations- Configures the application's translation dictionaries.
t- Resolves a translated message by path and replaces the provided parameters.
Money- Represents a monetary amount in integer cents and provides arithmetic operations.
NumberFormatter- Builds and transforms a numeric value before locale-aware formatting.
formatMoney- Formats a Money or numeric value with the requested currency and locale options.
parseMoneyInput- Parses a localized text value into a Money amount.
MoneyFormatOptions- Type. Locale and number-format options for formatMoney.
StorageType- Identifies the native storage strategies accepted by createNativeStore.
createNativeStore- Creates a named store with the selected storage type, or returns it when reuse is enabled.
NativeStorageInterface- Type. Public surface returned by createNativeStore.
v-t- Concept. Resolves translated children from a key.
v-money- Concept. Formats money input and stores minor units.
deepCloneUnfreeze- Creates a mutable deep clone of the provided value.
deepFreeze- Freezes an object graph recursively.
ensureIn- Checks whether a value belongs to an allowed collection.
get- Reads a nested value by path and returns the provided fallback when needed.
hasChanged- Checks whether the current value differs from the previous value.
hasLength- Checks whether a value has the requested length.
hasLengthBetween- Checks whether a value length falls within an inclusive range.
hasMaxLength- Checks whether a value stays within a maximum length.
hasMinLength- Checks whether a value reaches a minimum length.
is- Checks whether a value matches the requested type or constructor.
isBetween- Checks whether a numeric value falls within an inclusive range.
isBoolean- Checks for a boolean value.
isEmpty- Returns whether the provided value is empty.
isFiniteNumber- Checks for a finite numeric value.
isFunction- Checks for a function.
isGreaterThan- Checks whether a numeric value exceeds a limit.
isLessThan- Checks whether a numeric value stays below a limit.
isNumber- Checks for a numeric value.
isObject- Checks for an object value.
isString- Checks for a string value.
pick- Creates an object with the selected keys from a source value.
set- Updates a nested object path.
Server
Event- Models a DOM event for server rendering.
ServerStorage- Provides request-scoped browser-like storage during server rendering.
document- Exposes the server-side document used by the DOM utilities.
domToHtml- Serializes a server-side DOM value as HTML.
domToHyperscript- Serializes server-side child nodes as hyperscript source.
htmlToDom- Parses HTML into a server-side DOM value.
htmlToHyperscript- Converts HTML text into hyperscript source.
icons- Produces an application icon set from one source image.
inline- Bundles build input for server-side tooling.
render- Serializes Valyrian.js views on the server.
sw- Provides the server build entry point for service worker assets.
IconsOptions- Type. Configuration for icon and manifest generation.
SwOptions- Type. Configuration for service worker file generation.
PWA
SwRuntimeManager- Exposes installing, registration, waiting and updateAvailable state and manages service worker updates.
registerSw- Registers a service worker file for the application.
SwRuntimeEvent- Type. Service worker runtime event names.
SwRuntimeState- Type. Service worker registration and update state.
SwRuntimeEnvironment- Type. Environment objects used by the service worker runtime.
CreateSwRuntimeOptions- Type. Service worker runtime configuration.
SwRuntime- Type. Public service worker runtime interface.
Context
createContextScope- Creates a named context boundary for values that belong to one execution flow.
getContext- Reads the value associated with a context boundary in the active execution.
hasContext- Reports whether the active execution contains a value for a context boundary.
isServerContextActive- Reports whether server context storage is active for the current execution.
runWithContext- Runs a synchronous or asynchronous callback with a value bound to a context boundary.
setContext- Supplies a scoped value to later context reads.
ContextScope- Type. Typed key for context operations.