Stone.js API
    Preparing search index...

    Interface PrerenderContract<EventType>

    Contract for the SSG orchestrator (implemented by the CLI): given the list of targets and a per-target renderer, produce the pre-rendered results. Kept here so the view layer and the build tool agree on the shape.

    interface PrerenderContract<EventType = unknown> {
        collectTargets: () => | PrerenderTarget<Record<string, string>>[]
        | Promise<PrerenderTarget<Record<string, string>>[]>;
        renderTarget: (
            target: PrerenderTarget,
            event: EventType,
        ) => Promise<PrerenderResult>;
    }

    Type Parameters

    • EventType = unknown

      The incoming event type.

    Index
    collectTargets: () => | PrerenderTarget<Record<string, string>>[]
    | Promise<PrerenderTarget<Record<string, string>>[]>

    Discover the routes to pre-render (static routes + expanded parameterized routes).

    renderTarget: (
        target: PrerenderTarget,
        event: EventType,
    ) => Promise<PrerenderResult>

    Render one target to HTML (reuses the SSR path with a synthetic event).