Interface WatchMapPackageOptions

interface WatchMapPackageOptions {
    allowInvalid?: boolean;
    applyUpdates?: boolean;
    cache?: false | MapPackageFetchCache;
    client: HonuaClient;
    debounceMs?: number;
    disableDefaultStyleRefResolver?: boolean;
    headers?: HeadersInit;
    immediate?: boolean;
    initialPackage?: HonuaMapPackage;
    intervalMs?: number;
    maxAgeMs?: number;
    now?: number | Date;
    onError?: ((error: unknown) => void | Promise<void>);
    onEvent?: ((event: MapPackageWatchEvent) => void | Promise<void>);
    onUpdate?: ((event: {
        applied: boolean;
        diff: undefined | MapPackageDiff;
        result: FetchMapPackageResult;
        type: "updated";
    }) => void | Promise<void>);
    realtime?: false | MapPackageRealtimeWatchOptions;
    requireStyleRefResolution?: boolean;
    resolvePath?: MapPackagePathResolver;
    resolveStyleRef?: StyleRefResolver;
    runtime?: HonuaMapRuntime;
    signal?: AbortSignal;
}

Hierarchy (view full)

Properties

allowInvalid?: boolean

Return invalid packages with diagnostics instead of throwing HonuaMapPackageError.

applyUpdates?: boolean

Defaults to true when runtime is supplied.

cache?: false | MapPackageFetchCache

In-memory response cache. Omit for a per-client default; pass false to bypass SDK validators.

client: HonuaClient
debounceMs?: number

Delay changed-package application to coalesce rapid fetches. Defaults to 0.

disableDefaultStyleRefResolver?: boolean

Disable the default /ogc/styles StyleRef resolver when no callback is supplied.

headers?: HeadersInit
immediate?: boolean

Fetch immediately on watcher creation. Defaults to true.

initialPackage?: HonuaMapPackage

Previous package snapshot for diffing when no runtime is supplied.

intervalMs?: number

Polling cadence. Defaults to 30 seconds.

maxAgeMs?: number

Emit a stale-package warning when the package timestamp is older than this many ms.

now?: number | Date
onError?: ((error: unknown) => void | Promise<void>)
onEvent?: ((event: MapPackageWatchEvent) => void | Promise<void>)
onUpdate?: ((event: {
    applied: boolean;
    diff: undefined | MapPackageDiff;
    result: FetchMapPackageResult;
    type: "updated";
}) => void | Promise<void>)

Realtime channel configuration. Omit to use package-advertised channels; pass false to force polling.

requireStyleRefResolution?: boolean

Treat unresolved style refs as validation errors instead of warnings.

Override id-to-path resolution. The default is /api/v1/map-packages/{encodeURIComponent(id)}.

resolveStyleRef?: StyleRefResolver

Resolve out-of-band style refs and inline successful bodies into the returned package. When omitted, defaults to resolving styleRefs.styleId against the server's OGC API – Styles surface (GET /ogc/styles/{styleId}) via createOgcStyleRefResolver. Pass a callback to override that path (back-compat), or set disableDefaultStyleRefResolver to skip it.

runtime?: HonuaMapRuntime

Runtime to update after a changed package is fetched.

signal?: AbortSignal