Skip to content
@drupflare/spool v1.0.0 GitHub
    Preparing search index...

    Type Alias Route

    a validated route with every default applied

    type Route = {
        catalogue?: RouteCommon["catalogue"];
        contentType?: string;
        documentBytes?: number;
        family?: Family;
        freshness: Freshness;
        mode?: Mode;
        navigation?: "document";
        offline: OfflineRule;
        origin?: string;
        pattern: string;
        persist: boolean;
        provision?: { futureViews?: number; maxBytes?: number; reuse?: number };
        provisionable?: false;
        query?: QuerySchema;
        retention?: Retention;
        scope: Scope;
        strategy: Strategy;
        sync: SyncRule;
        template?: CompiledTemplate;
        depends(ctx: RouteContext): readonly string[] | Promise<readonly string[]>;
        load(ctx: RouteContext): unknown;
    }
    Index
    • tags the artifact is built from; a change to one invalidates it

      Parameters

      Returns readonly string[] | Promise<readonly string[]>

    the route's catalogue function, when it declares one

    contentType?: string

    content type of a data route's local answer

    documentBytes?: number

    compressed bytes of the document the route renders

    family?: Family

    the held dataset row the route renders, when it declares a family

    freshness: Freshness

    the staleness contract with every default applied

    mode?: Mode

    serve or shadow; absent means the server decides

    navigation?: "document"

    document when the page leaves this family's links and forms to the browser

    offline: OfflineRule

    whether a snapshot may be shown while offline, after the default

    origin?: string

    the API origin a cross-origin data family answers for

    pattern: string

    the path pattern the route matches

    persist: boolean

    whether the artifact survives a worker restart; true by default

    provision?: { futureViews?: number; maxBytes?: number; reuse?: number }

    provisioning priors that override the server's for this route

    Type Declaration

    • OptionalfutureViews?: number

      later views one provisioned artifact is expected to serve; the server's prior when absent

    • OptionalmaxBytes?: number

      refuses an artifact whose stored JSON is over this many bytes; no budget when absent

    • Optionalreuse?: number

      chance a provisioned artifact serves a later view; the server's prior when absent

    provisionable?: false

    false for a family route with no load, which has no artifact to provision

    query?: QuerySchema

    query strings the worker answers from the stored collection

    retention?: Retention

    at-rest key lifetime; set only on principal routes

    scope: Scope

    public or principal, after the default

    strategy: Strategy

    how the route is answered locally

    sync: SyncRule

    when a soft route past its bound refreshes

    template?: CompiledTemplate

    the compiled template of a template route