Stone.js API
    Preparing search index...

    Interface ViewEngine<VNode, Root, Host>

    The contract each concrete engine (React, Vue, …) implements. use-view orchestration calls only through this interface, so nothing engine-specific leaks into the shared layer.

    interface ViewEngine<
        VNode = unknown,
        Root extends ViewRoot = ViewRoot,
        Host = Element,
    > {
        createElement: (
            component: unknown,
            props?: Record<string, unknown>,
            ...children: VNode[],
        ) => VNode;
        hydrate: (node: VNode, container: Host) => Root | Promise<Root>;
        mount: (node: VNode, container: Host) => Root | Promise<Root>;
        renderToStream?: (
            node: VNode,
            options?: StreamRenderOptions,
        ) => Promise<ReadableStream<Uint8Array<ArrayBufferLike>>>;
        renderToString: (node: VNode) => string | Promise<string>;
        wrapApp?: (node: VNode, context: unknown) => VNode;
    }

    Type Parameters

    • VNode = unknown

      The engine's node type.

    • Root extends ViewRoot = ViewRoot

      The engine's root handle (defaults to ViewRoot).

    • Host = Element

      Where the engine mounts. A DOM Element on the web, but a native platform has no element tree, so the host stays generic: React Native registers a root component instead, and its engine names its own host type.

    Index
    createElement: (
        component: unknown,
        props?: Record<string, unknown>,
        ...children: VNode[],
    ) => VNode

    Create an element/vnode from a component and props.

    hydrate: (node: VNode, container: Host) => Root | Promise<Root>

    Hydrate server-rendered markup in a host (client, after SSR/SSG). May be async.

    mount: (node: VNode, container: Host) => Root | Promise<Root>

    Mount a node into a host (client, fresh render). May be async (lazy client runtime).

    renderToStream?: (
        node: VNode,
        options?: StreamRenderOptions,
    ) => Promise<ReadableStream<Uint8Array<ArrayBufferLike>>>

    Render a node to a stream (streaming SSR). Optional: engines that support it (React 19 renderToPipeableStream / renderToReadableStream) implement it; the renderer falls back to renderToString when absent. Returns a Web ReadableStream for runtime-agnostic piping (Node, edge/WinterCG).

    renderToString: (node: VNode) => string | Promise<string>

    Render a node to an HTML string (SSR/SSG, buffered). May be sync or async.

    wrapApp?: (node: VNode, context: unknown) => VNode

    Wrap the application tree with the engine's context/providers.