@expofp/floorplan
Version:
Interactive floor plan library for expos and events
135 lines • 5.15 kB
TypeScript
import { Box } from '@expofp/geometry';
import { type Camera, type ListPanel, type PlannerOptions } from '@expofp/schema';
import { createRoot } from 'react-dom/client';
import FloorPlanLoader from './floorplan.loader';
import { CurrentPosition, MarkersData } from './store/RouteStore';
import { Visibility } from './store/types';
import type { GeoConfig } from './types';
import { Bounds, POISelectors } from './types/sdk.types';
export default class FloorPlanReady extends FloorPlanLoader {
root: ReturnType<typeof createRoot>;
protected init(): void;
selectBooth(nameOrExternalId: string | string[]): void;
selectExhibitor(nameOrExternalId: string | string[]): void;
highlightExhibitors(externalIds: string[]): void;
highlightBooths(externalIds: string[]): void;
highlightEntities(externalIds: string[]): void;
selectRoute(startOrWaypoints: RouteWaypoint | RouteWaypoint[], to?: RouteWaypoint): void;
getOptimizedRoutes(waypoints: RouteWaypoint[]): RouteInfo[];
selectCurrentPosition(point: CurrentPosition, focus: boolean, icon?: number): void;
setBookmarks(bookmarks: {
name?: string;
externalId?: string;
bookmarked: boolean;
}[]): void;
setEntitiesBookmarks(bookmarks: {
type: 'exhibitor' | 'event' | 'speaker' | 'booth';
name?: string;
externalId?: string;
bookmarked: boolean;
}[]): void;
setEntitiesVisited(entities: {
type: 'exhibitor' | 'event';
name?: string;
externalId?: string;
visited: boolean;
}[]): void;
setMarkers(markersData: MarkersData): void;
selectMarker(id: string, focus?: boolean): Promise<void>;
drawCircles(circles: {
x: number;
y: number;
radius: number;
color?: string;
}[]): void;
checkRoutes(): void;
updateLayerVisibility(layer: string, visible: boolean): void;
getCenterCoordinates(): FloorPlanGetCoordsEvent;
exhibitorsList(): FloorPlanExhibitor[];
boothsList(): FloorPlanBooth[];
categoriesList(): FloorPlanCategory[];
selectCategory(nameOrSlug?: string): void;
select(slugOrExternalId: string): void;
showList(list: ListPanel): void;
selectTour(tourId: string): void;
openPlanner(options?: PlannerOptions): void;
startBuildRoute(): void;
applyParameters(queryRaw: string): void;
getVisibility(): Visibility;
setVisibility(visibility: Visibility): void;
findLocation(): void;
zoomIn(): void;
zoomOut(): void;
switchView(): void;
setCamera(camera: Camera): void;
getCamera(): Camera;
zoomTo(selectors: POISelectors, options?: {
padding?: number;
}): void;
getBounds(selectors: POISelectors): Bounds | undefined;
fitBounds(bounds?: Bounds, options?: {
padding?: number;
}): void;
getBoothRect(name: string): BoothRect;
convertToGeo(x: number, y: number): [number, number] | never;
getGeoConfig(): GeoConfig | null;
unstable_destroy(): void;
search(term: string): Promise<{
item: unknown;
score: number;
}[]>;
getFloors(): Floor[];
activateFloor(floorId: {
name?: string;
index?: number;
}): void;
showPathway(pathwayId: string, externalIds: string[]): void;
showPathwayOnly(pathwayId: string, floorId: string): void;
hidePathways(): void;
showSearch(): void;
changeLanguage(langId: string): void;
isGpsTrackingEnabled(): boolean;
setGpsTrackingEnabled(value: boolean): void;
deselectCurrentPosition(): void;
deselectRoute(): void;
reset(): void;
selectAccessibleRoute(waypoints: RouteWaypoint[]): void;
}
/**
* Backward-compatible return shape of the public `getBoothRect()` API.
*
* Internally booth footprints are now `@expofp/geometry` `Box`es, but external
* SDK consumers of `getBoothRect()` rely on the legacy `core/Rect` instance
* surface (`x1/y1/x2/y2`, the `cx/cy/w/h` getters, and the full method set).
* This class reproduces that surface exactly and is built from a `Box`'s
* `min`/`max` corners at the API boundary. It is intentionally NOT exported, so
* no other module can import it — the only way to obtain one is `getBoothRect()`.
*/
declare class BoothRect {
x1: number;
y1: number;
x2: number;
y2: number;
get h(): number;
get w(): number;
get cx(): number;
get cy(): number;
constructor(x1: number, y1: number, x2: number, y2: number);
static fromBox(box: Box): BoothRect;
static fromCxcywh(cx: number, cy: number, w: number, h: number): BoothRect;
contains(r: BoothRect): boolean;
intersects(r: BoothRect): boolean;
getIntersection(r: BoothRect): BoothRect;
getRotated90(): BoothRect;
normalize(width: number, height: number): BoothRect;
withPadding(x: number, y?: number): BoothRect;
scale(s: number): BoothRect;
getArea(): number;
clone(): BoothRect;
translate(dx: number, dy: number): this;
equals(r: BoothRect): boolean;
toString(): string;
containsPoint(x: number, y: number): boolean;
}
export {};
//# sourceMappingURL=floorplan.ready.d.ts.map