@expofp/floorplan
Version:
Interactive floor plan library for expos and events
33 lines • 2 kB
TypeScript
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;
};
//# sourceMappingURL=defs.d.ts.map