@expofp/floorplan
Version:
Interactive floor plan library for expos and events
60 lines • 2.2 kB
TypeScript
import type { Box } from '@expofp/geometry';
import type { Kiosk } from '../components/Kiosk/SetKiosk/types';
import type { ArbitraryPoint } from './adapters';
/**
* Structural read-model ports for {@link bindMobxReactions}.
*
* The glue only reads raw observables off the efp stores, so these are type-only
* shapes the concrete `RouteStore` / `UIState` / `LayerStore` satisfy structurally
* — the live instances pass straight through, MobX tracking is preserved, and the
* glue stays free of `store/*` types.
*/
/** Booth-shaped endpoint, narrowed to what the glue + `boothToEndpoint` read. */
export interface BoothSource {
/** `number` (efp `Booth.id`) — discriminates against `ArbitraryPoint`'s string id. */
readonly id: number;
readonly rect: Box;
readonly rotate: number;
readonly layer?: {
readonly name?: string;
} | null;
}
export type RouteEndpointSource = BoothSource | ArbitraryPoint;
export interface RouteView {
readonly from: RouteEndpointSource | null;
readonly to: RouteEndpointSource | null;
readonly waypoints?: readonly BoothSource[];
}
/** User position the glue feeds to `positionInput` / `toArbitraryPoint`. */
export interface PositionView {
readonly x: number;
readonly y: number;
readonly z?: number | string;
readonly angle?: number;
}
export interface RouteStorePort {
readonly currentPosition: PositionView | null;
readonly iconType: number;
readonly onlyAccessible: boolean;
/** Only `.length` is read (route-built recovery check). */
readonly routeLines: readonly unknown[];
readonly currentRouteLayer: {
readonly name: string;
} | null;
rebuildRouteFromPosition(from: ArbitraryPoint): void;
}
export interface UiStatePort {
readonly selectedRoute: RouteView | null;
readonly kioskData: Kiosk | null | undefined;
/** Reaction dependency only. */
readonly getRouteNextFloor: string | null;
}
export interface LayerStorePort {
readonly floors: readonly {
readonly name: string;
readonly active: boolean;
}[];
readonly mode: number;
readonly layersLoaded: boolean;
}
//# sourceMappingURL=storePorts.d.ts.map