UNPKG

@expofp/floorplan

Version:

Interactive floor plan library for expos and events

40 lines 2.75 kB
import { ImageDef, ImageSource, LayerDef, LineDef, Polygon as RendererPolygon, Rect as RendererRect, ShapeDef, TextAlignment, TextDef, TextLineDef, RenderableDefCollection, SceneDef, PointWithinSceneData, Vector2Like } from '@expofp/renderer'; import { Box, Polygon, Rect } from '@expofp/geometry'; import { MeshType, Line, TextLines, DefOptions } from './types'; /** * Converts a geometry {@link Box} (axis-aligned, no rotation) to a renderer * {@link RendererRect}. Preserves min/max exactly; rotation is always 0. */ export declare function boxToRenderer(box: Box): RendererRect; /** * Converts a geometry {@link Rect} (center + size + rotation + elevation) to a * renderer {@link RendererRect}. The renderer Rect is constructed from * unrotated min/max corners derived from `center` ± `size/2`; rotation passes * through unchanged (both packages share positive = clockwise, y-down). */ export declare function rectToRenderer(rect: Rect): RendererRect; /** * Converts a geometry {@link Polygon} to a renderer {@link RendererPolygon}. * Vertices are mapped to `{ x, y, z }` triples (z = polygon elevation); * indices are passed through unchanged. */ export declare function polygonToRenderer(polygon: Polygon): RendererPolygon; export declare function rectToShapeDef(rect: SVGRectElement, color?: string): ShapeDef; export declare function meshToShapeDef(mesh: MeshType, color: string): ShapeDef; export declare function createShapeDef(shape: Box | Rect | Polygon, color?: string): ShapeDef; export declare function createImageDef(source: ImageSource, bounds: Rect, options?: DefOptions & { origin?: [number, number]; }): ImageDef; export declare function createTextDef(textLines: TextLineDef[], bounds: Rect, padding: [number, number], alignment: TextAlignment, options?: DefOptions): TextDef; export declare function createTextDefLines(textLines: TextLines, color: string, fontSize: number, fontUrl?: [string, string]): TextLineDef[]; export declare function createLineDef({ p0, p1 }: Line, color?: string, width?: number): LineDef; export declare function createLayerDef(name: string, children: RenderableDefCollection, options?: DefOptions): LayerDef; export declare function createSceneDef(layers: LayerDef[], viewboxRect: Box | SVGRectElement, background?: string, memoryLimit?: number): SceneDef; export declare function createShapeDot(rect: Rect, color?: string, radius?: number): ImageDef; export declare function isDefaultScene(sceneId: string | undefined): boolean; export declare function pickDefaultScene(data: PointWithinSceneData[]): PointWithinSceneData; export declare function pickDefaultScenePoint(points: { sceneId?: string; point: Vector2Like; }[]): Vector2Like; //# sourceMappingURL=defs.d.ts.map