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

    Type Alias RouteCommon

    the declaration fields every strategy shares

    type RouteCommon = {
        auth?: "principal";
        documentBytes?: number;
        freshness?: Partial<Freshness>;
        mode?: Mode;
        offline?: OfflineRule;
        persist?: boolean;
        provision?: { futureViews?: number; maxBytes?: number; reuse?: number };
        retention?: Retention;
        scope?: Scope;
        sync?: SyncRule;
        catalogue?(
            ctx: RouteContext,
        ): readonly CatalogueGuess[] | Promise<readonly CatalogueGuess[]>;
        depends?(ctx: RouteContext): readonly string[] | Promise<readonly string[]>;
    }
    Index
    • Pages a device on this route may open next, each with the share of devices expected to (from the site's own nextShare over the sink, link position, or a fixed prior). The server ships the data of those that repay their transfer, never their HTML. Only template, projection and data routes can be entries.

      Parameters

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

    • tags the artifact is built from; records and projections the load registers are added

      Parameters

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

    auth?: "principal"

    principal is the same as scope: 'principal'; a conflicting scope is refused

    documentBytes?: number

    compressed bytes of the document this route renders, which a catalogue entry for it replaces; the server's prior when absent

    freshness?: Partial<Freshness>

    overrides the scope's default maxStale and mode

    mode?: Mode

    shadow renders locally and compares but never serves; the server's mode when absent

    offline?: OfflineRule

    serve shows a snapshot offline, refuse does not; default follows the scope

    persist?: boolean

    keep the artifact across worker restarts; default true

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

    overrides the provisioning priors for this route when the server decides whether to ship it

    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

    retention?: Retention

    a principal route's at-rest key; default persistent, session for a shared device

    scope?: Scope

    public or principal; public when absent

    sync?: SyncRule

    how a soft route past its bound refreshes; default background