Imports
Every public @whisq/* package and entry point, verified against the published package.json exports field. Use this page to confirm where a given symbol lives before writing an import line.
If a symbol isn’t listed here, it either hasn’t been published yet or it’s internal (not part of the public API).
@whisq/core
Section titled “@whisq/core”The primary package. Most application imports come from here.
. (main entry)
Section titled “. (main entry)”import { signal, component, div, button, each, bind } from "@whisq/core";import type { Signal, ElementRef, Ref, EventHandler, WhisqEvent } from "@whisq/core";Reactive primitives: signal, computed, effect, batch · types: Signal, ReadonlySignal
Element helpers (every HTML element is exported): div, span, a, img, button, input, textarea, select, option, label, form, h1, h2, h3, h4, h5, h6, p, strong, em, small, pre, code, ul, ol, li, table, thead, tbody, tr, th, td, header, footer, nav, main, section, article, aside, audio, video, iframe, br, hr · type: WhisqNode
Hyperscript helper: h (for tags not pre-exported), raw (inject HTML strings)
Rendering: mount, each, match, when, errorBoundary, portal, transition
Components & lifecycle: component, onMount, onCleanup, resource, createContext, provide, inject, useHead · types: ComponentDef, Resource, ResourceOptions, ResourceSourceOptions, InjectionKey
Refs: ref · types: ElementRef<T>, Ref<T>
Event types: EventHandler<E, T>, WhisqEvent<K, T> (types only)
Bind: bind (single-signal two-way binding with as: "text" | "number" | "checkbox" | "radio" options), bindField (field-inside-signal-array binding for list items, with keyBy defaulting to t => t.id) · types: BindOptions, TextBind, NumberBind, CheckboxBind, RadioBind, BindFieldOptions
Styling: sheet, theme, styles, sx, cx, rcx · types: StyleObject, ThemeOptions
Dev diagnostics: WhisqStructureError (runtime class for dev-mode structure violations), WhisqKeyByError (runtime class thrown by bindField on no-match writes in dev mode — see /api/bindfield/) · types: WhisqStructureErrorFields, WhisqKeyByErrorFields
./collections
Section titled “./collections”Reactive collections with per-key / per-value subscriptions, plus collection helpers. Lives on a sub-path so the main entry stays under 5 KB.
import { signalMap, signalSet, partition } from "@whisq/core/collections";Exports: signalMap<K, V>(), signalSet<T>(), partition<T>() (since alpha.8 — split a signal-held array into matching / not-matching derived signals)
./persistence
Section titled “./persistence”localStorage-backed signals. The State Management guide covers the full option surface (storage, serialize/deserialize, schema) and the SSR/quota/schema-validation behaviors the helper handles internally.
import { persistedSignal } from "@whisq/core/persistence";
const todos = persistedSignal("whisq.todos", []);Exports: persistedSignal<T>() — creates a Signal<T> that loads from localStorage on module init and writes on every change. See PersistedSignalOptions in the framework source for configuration options (serializer, skip-initial-write, etc.).
./forms
Section titled “./forms”Deep-path form bindings. Sub-path so apps that only need bind() and bindField() (the 80% case) pay no bundle cost — the default bind / bindField exports stay on the main entry.
import { bindPath } from "@whisq/core/forms";
form( input({ ...bindPath(user, ["profile", "name"]) }), input({ type: "checkbox", ...bindPath(user, ["prefs", "dark"], { as: "checkbox" }) }),);Exports: bindPath() — two-way binding for a field at an arbitrary object path inside a signal-held record. Mirrors bind() / bindField() discriminator shapes (text / number / checkbox / radio). See /api/bindpath/ for the full reference.
Random-id generation. Sub-path so apps that don’t need client-side id generation (e.g. SSR apps where the server hands out ids) pay no bundle cost. Since alpha.8.
import { randomId } from "@whisq/core/ids";
const todo = { id: randomId(), text: "Learn Whisq", done: false };Exports: randomId() — returns a UUID-v4-shaped string. Prefers native crypto.randomUUID() when available; falls back to a Math.random synthesis with the same v4 shape for older targets. Suitable for UI row keys and each({ key }) ids — not a security primitive.
@whisq/router
Section titled “@whisq/router”Signal-based router for Whisq applications — a single router.current signal, push-state navigation, nested routes, guards, and scroll restoration.
import { createRouter, RouterView, Link } from "@whisq/router";import type { Router, RouterConfig, RouteConfig, RouteState, NavigationGuard, AfterGuard, ScrollBehaviorOption,} from "@whisq/router";API reference:
| Export | Page |
|---|---|
createRouter() | /api/createrouter/ |
RouterView() | /api/routerview/ |
Link() | /api/link/ |
| Reading route state | /api/route-state/ |
End-to-end walkthrough: Router basics example. Patterns: Routing guide.
@whisq/ssr
Section titled “@whisq/ssr”Server-side rendering for Whisq applications.
import { renderToString, renderToStream } from "@whisq/ssr";Used from a server framework (Vite SSR, Node HTTP, etc.) to produce initial HTML. Pairs with @whisq/vite-plugin for the build-side plumbing.
@whisq/vite-plugin
Section titled “@whisq/vite-plugin”Vite plugin for Whisq — file-based routing, HMR, optimized builds.
import { defineConfig } from "vite";import { whisq } from "@whisq/vite-plugin";
export default defineConfig({ plugins: [whisq()],});@whisq/testing
Section titled “@whisq/testing”Testing utilities for Whisq components — render, screen queries, fireEvent.
import { render, screen, fireEvent, cleanup } from "@whisq/testing";See /guides/testing/ for the patterns the docs use.
@whisq/devtools
Section titled “@whisq/devtools”DevTools runtime hook — signal inspection, component tree, effect tracking.
import { connectDevTools } from "@whisq/devtools";if (import.meta.env.DEV) connectDevTools();Installs globalThis.__WHISQ_DEVTOOLS__ — a passive surface a browser extension or console script can read. Apps opt in by calling registerSignal / registerComponent / logEvent themselves; there’s no auto-instrumentation. Full API: /api/devtools/.
@whisq/sandbox
Section titled “@whisq/sandbox”Sandboxed code execution — isolated environment with configurable limits. Used internally by the whisq.dev playground.
import { runInSandbox } from "@whisq/sandbox";Primarily for tooling that needs to run untrusted Whisq code (playgrounds, snippet runners, MDX live examples). End-user app code doesn’t typically import this.
Versioning
Section titled “Versioning”All packages release in lockstep under the same 0.x.y-alpha.N tag. The whisqCoreVersion field in this repo’s package.json pins the version these docs describe — currently the version at the bottom of every docs page.
The drift-check script (scripts/check-llm-reference-sync.mjs) verifies the LLM reference card stays in sync with @whisq/core’s published public-api manifest. There’s no equivalent check for the other packages yet — if a secondary-package example on this site doesn’t compile against a fresh install, the package probably moved faster than the docs did.
For AI/scaffolder workflows: resolve the current version from the npm registry, never from a CDN @latest alias — see LLM Reference → Current version.
Docs current to v0.1.0-alpha.9 . All releases →