@expofp/floorplan
Version:
Interactive floor plan library for expos and events
121 lines • 4.85 kB
TypeScript
import { type ArbitraryPoint, type RouteLine } from '../wayfinding';
import { type Booth } from './BoothStore';
import type { Exhibitor } from './ExhibitorStore';
import { type Layer } from './LayerStore';
import type RootStore from './RootStore';
export default class RouteStore {
rootStore: RootStore;
cpTimeout: number | undefined;
routeLines: RouteLine[];
routeDistance: number | null;
currentPosition: CurrentPosition | null;
requestCompass: boolean;
iconType: number;
tempToBooth: Booth | null;
focusEnabled: boolean;
prevZ: string | null;
markersData: MarkersData;
prevMarkers: Marker[];
/** Cancels the camera move still waiting for a floor to come on screen (see `revealLayer`). */
private pendingReveal;
showAccessible: boolean;
onlyAccessible: boolean;
currentRouteLayer: Layer | null;
currentRouteExhibitor: Exhibitor | null;
constructor(rootStore: RootStore);
get canFindLocation(): boolean;
selectRoute(route: Route | null, resetList?: boolean, immediate?: boolean): void;
/** Rebuilds the current route with the live position as FROM, applied immediately (no 200ms defer) */
rebuildRouteFromPosition(newFrom: ArbitraryPoint): void;
/** Default FROM for `selectRoute` when only TO is given. Priority: CP > kiosk anchor > none. */
private resolveFallbackFrom;
setStartPoint(booth: Booth): void;
get pathLayers(): {
id: number;
layer: Layer | null;
}[];
/**
* Used only by the SDK `getBooth(RouteWaypoint)` path for coord-form
* waypoints (`floorplan.ready.tsx`). Internal callers prefer
* `toArbitraryPoint(currentPosition, ...)` — graph snap happens inside the
* engine, no booth proxy needed.
*/
getNearestBooth(position: CurrentPosition): Booth | null;
setMarkers(data: MarkersData): void;
selectMarker(id: string, focus: boolean): Promise<void>;
get selectedMarkers(): Marker[];
get layers(): Layer[];
clickRoute(from: Booth, to: Booth): void;
selectCurrentPosition(point: CurrentPosition | null, focus?: boolean, icon?: number): void;
findLocation(): void;
/** The dot, plus — when it lies outside the drawing — enough of the nearest map edge for context. */
private findLocationRect;
/**
* Focus for a position update (first fix, or the dot changing floor): bring
* its floor on screen, then move the camera onto it keeping the zoom —
* `panTo` in the floor plan renderer; under MapLibre the renderer camera is
* an external-mode no-op stub, so the move goes through the adapter's
* `moveToLocation` reaction instead. Waits for the floor to be visible first
* (see `revealLayer`).
*/
private focusOnPosition;
routeUnits: string;
get routeInfo(): {
distance: string;
units: string;
time: number;
} | null;
updateRoute(routeLines: RouteLine[], distance?: number): void;
updateRouteDistance(distance: number): void;
updateRoutePoints(): void;
checkRoutes(): void;
isGpsTrackingEnabled: boolean;
setGpsTrackingEnabled(value: boolean): void;
get gpsEnabled(): boolean;
setOnlyAccessible(value: boolean): void;
}
export declare function findBooth(str: string): Booth | undefined;
export declare function findEntityByExternalId(externalId: string): {
type: 'booth' | 'exhibitor';
entity: Booth | Exhibitor;
} | undefined;
export declare function separateExternalIds(externalIds: string[]): {
boothExternalIds: string[];
exhibitorExternalIds: string[];
};
export declare function extractRoute(from: string, to: string, waypoints: string[]): Route;
export declare class Route {
from: Booth | ArbitraryPoint | null;
to: Booth | ArbitraryPoint | null;
waypoints?: Booth[] | undefined;
constructor(from: Booth | ArbitraryPoint | null, to: Booth | ArbitraryPoint | null, waypoints?: Booth[] | undefined);
}
/** Where the blue dot is: plan coordinates, the floor it sits on, and the bearing it faces. */
export declare class CurrentPosition {
x: number;
y: number;
z?: number | string | undefined;
angle?: number | undefined;
lat?: number | undefined;
lng?: number | undefined;
constructor(x: number, y: number, z?: number | string | undefined, angle?: number | undefined, lat?: number | undefined, lng?: number | undefined);
}
export interface Marker extends CurrentPosition {
id: string;
icon: string;
selectedIcon: string;
position: 'centertop' | 'lefttop' | 'centerbottom';
active?: boolean;
}
export interface MarkerIcon {
name: string;
content: string;
width: number;
height: number;
scale?: number;
}
export interface MarkersData {
icons: MarkerIcon[];
markers: Marker[];
}
//# sourceMappingURL=RouteStore.d.ts.map