import type { WorldXZ } from "./minimap.js"; /** A fast-travel destination the game defines. Discovery is tracked separately. */ export interface TravelPointDef { id: string; name: string; /** World-XZ location — feeds distance sorting and map markers. */ position: WorldXZ; region?: string; icon?: string; /** Discovered from the start (a home base / starting waypoint). */ initial?: boolean; meta?: TMeta; } /** A destination plus its discovery state (and distance from a query origin, when given). */ export interface TravelPointView extends TravelPointDef { discovered: boolean; discoveredAt: number | null; /** XZ distance from the query origin passed to `list`/`destinations`/`nearest`, else undefined. */ distance?: number; } /** Serializable discovery state. */ export interface FastTravelSnapshot { discovered: Record; } /** A network of fast-travel points with per-player discovery + distance queries. */ export interface FastTravelNetwork { /** Unlock a point; returns the newly-discovered view, or null if unknown or already discovered. */ discover(id: string): TravelPointView | null; isDiscovered(id: string): boolean; get(id: string): TravelPointView | null; /** All points (discovery state + optional distance), in definition order — or by distance when `from` is given. */ list(from?: WorldXZ): readonly TravelPointView[]; /** Discovered points only (distance-sorted when `from` is given). */ destinations(from?: WorldXZ): readonly TravelPointView[]; /** Nearest discovered point to `from` (optionally excluding an id — e.g. the one you're standing on). */ nearest(from: WorldXZ, options?: { exclude?: string; }): TravelPointView | null; /** Whether a destination can be traveled to (discovered). Combat/cost gates are the game's to add. */ canTravel(id: string): boolean; discoveredCount(): number; total(): number; subscribe(listener: () => void): () => void; snapshot(): FastTravelSnapshot; restore(snapshot: FastTravelSnapshot): void; } /** Options for {@link createFastTravelNetwork}. */ export interface FastTravelOptions { points: readonly TravelPointDef[]; /** Injected clock (ms). Default `Date.now`. */ now?: () => number; /** Fires when a point is discovered for the first time — wire to a toast/notification. */ onDiscover?: (point: TravelPointView) => void; } /** * A fast-travel network: defined destinations plus per-player discovery, with * distance-sorted queries, a `nearest` lookup, a `canTravel` gate, an * `onDiscover` seam, and serializable `snapshot`/`restore`. Travel itself is a * teleport the game applies to `TravelPointView.position`; this owns the * unlock/where-can-I-go state. Points marked `initial` start discovered. * * @capability fast-travel network of fast-travel destinations with discovery, distance-sorted queries, nearest lookup, a travel gate, and serializable state */ export declare function createFastTravelNetwork(options: FastTravelOptions): FastTravelNetwork;