Documentation
    Preparing search index...

    Interface MockLocationOptions

    Factory options for the location mock.

    const location = createMockLocationService({ grant: 'coarse-only', autoplay: true, tickMs: 1000 });
    
    interface MockLocationOptions {
        autoplay?: boolean;
        clock?: MockClock;
        fixLatencyMs?: number;
        grant?: "granted" | "denied" | "coarse-only";
        latencyMs?: number;
        scheduler?: MockScheduler;
        seed?: number;
        tickMs?: number;
        unavailable?: "unavailable" | "blocked";
    }

    Hierarchy (View Summary)

    Index

    Properties

    autoplay?: boolean

    Advance the route automatically through the scheduler.

    clock?: MockClock

    Clock used for timestamps. Default: Date.now.

    fixLatencyMs?: number

    Simulated time to obtain a fresh fix; location.current with a smaller timeout fails with timeout. Default 0.

    grant?: "granted" | "denied" | "coarse-only"

    Simulated user decision for location.permission. Default granted.

    latencyMs?: number

    Artificial latency (ms) applied before each result. Default 0, which responds synchronously inside handleMessage.

    scheduler?: MockScheduler

    Scheduler used for deferred pushes. Default: setTimeout.

    seed?: number

    Seed for deterministic ids and fixture ordering. Default 1.

    tickMs?: number

    Interval for autoplay. Default 1000.

    unavailable?: "unavailable" | "blocked"

    Report available: false with this reason.