@expofp/floorplan
Version:
Interactive floor plan library for expos and events
109 lines • 4.03 kB
TypeScript
import { Point } from "simple-geometry";
import type { ArbitraryPoint } from "../wayfinding/adapters";
import type { RouteLine } from "../wayfinding/core";
import { Booth } from "./BoothStore";
import { Exhibitor } from "./ExhibitorStore";
import { Layer } from "./LayerStore";
import RootStore from "./RootStore";
export default class RouteStore {
rootStore: RootStore;
cpTimeout: number;
routeLines: RouteLine[];
routeDistance: number;
currentPosition: CurrentPosition;
requestCompass: boolean;
iconType: number;
tempToBooth: Booth;
focusEnabled: boolean;
prevZ: string;
markersData: MarkersData;
prevMarkers: Marker[];
showAccessible: boolean;
onlyAccessible: boolean;
currentRouteLayer: Layer;
currentRouteExhibitor: Exhibitor;
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;
}[];
/**
* 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, focus?: boolean, icon?: number): void;
findLocation(): void;
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);
}
export declare class CurrentPosition extends Point {
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