UNPKG

@expofp/floorplan

Version:

Interactive floor plan library for expos and events

38 lines • 2.21 kB
import { Box, Mesh, type Polygon, Rect, type TriangleIndex } from '@expofp/geometry'; import { type ImageDef, type ImageSource, type LayerDef, type RenderableDefCollection, type SceneDef, type ShapeDef, type SharedDef, type TextAlignment, type TextDef, type TextLineDef } from '@expofp/renderer'; /** * What svgMesh3d puts on `window.__fpPaths`: vertices as bare number tuples, which is why this is * not geometry's `MeshLike` — that one holds points. The third component is optional because * svgMesh3d emits it per vertex and only sometimes. */ export interface MeshType { positions: [number, number, number?][]; cells: TriangleIndex[]; } export type TextLines = [string[], string[]]; export interface FontSizeFactor { scaleFactor: number; value: number; lines: string[]; } 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 | Mesh, color?: string): ShapeDef; export declare function createImageDef<Source extends ImageSource>(source: Source, bounds: Rect, options?: SharedDef & { origin?: [number, number]; }): ImageDef & { source: Source; }; export declare function createTextDef(textLines: TextLineDef[], bounds: Rect, padding: [number, number], alignment: TextAlignment, options?: SharedDef): TextDef; export declare function createTextDefLines(textLines: TextLines, color: string, fontSize: number, fontUrl?: [string | undefined, string | undefined]): TextLineDef[]; export declare function createLayerDef(name: string, children: RenderableDefCollection, options?: SharedDef): LayerDef; export declare function createSceneDef(layers: LayerDef[], viewboxRect: Box | SVGRectElement, background?: string): SceneDef; export declare function createShapeDot(rect: Rect, color?: string, radius?: number): ImageDef & { source: HTMLCanvasElement; }; /** * The CSS size a booth's dot is drawn at. For the drawers that receive a dot rather than create * one, and so cannot read the radius it was made from. */ export declare const SHAPE_DOT_CSS_PX: number; //# sourceMappingURL=defs.d.ts.map