UNPKG

@expofp/floorplan

Version:

Interactive floor plan library for expos and events

45 lines • 2.12 kB
import { Rect } from '@expofp/geometry'; import { type Booth } from '../../../../store/BoothStore'; import { type Layer } from '../../../../store/LayerStore'; import type { ImageUrls } from '../../../../utils/loadImagesInBatches'; export declare function loadLayersImages(): Promise<void>; export declare const getImageLayerName: (layerName: string) => string; export declare const getModelLayerName: (layerName: string) => string; export declare function mapBoothsLogos(booths: Booth[]): Map<number, ImageUrls>; /** * A layer's designer images, split by what they actually are. An `<image>` carrying * {@link MODEL_3D_ATTRIBUTE} is a placeholder for a 3D model, so it must be kept out of image * loading entirely — its `href` is never fetched — and rendered from the model URL instead. */ export interface LayerGraphics { /** Ordinary images, to be loaded and drawn as textured quads. */ icons: SVGImageElement[]; /** Images standing in for 3D models. */ models: SVGImageElement[]; } export declare function getLayerGraphics(layer: Layer): LayerGraphics; /** Where one booth's logo goes. */ export interface BoothImg { /** The booth the logo sits in. */ booth: Booth; /** The booth's slug, which becomes the def's name. */ name?: string; /** * The booth center, the fitted logo size, and the booth rotation. * * The image def keeps this `Rect` by reference, and `rotateImageDef` and `flipImageDef` rotate * it in place. Each booth gets its own, so no other owner sees those writes. */ bounds: Rect; } /** * Fits a logo inside a booth and returns where the logo goes. * * This function takes the logo's aspect ratio, not the logo and not its pixel size. The ratio is * the only fact it ever needed from the image: every length below comes from the booth. * @param booth - The booth to fit the logo into. * @param ratio - The logo's width divided by its height. A finite positive number. * @returns The placement. */ export declare function createBoothImg(booth: Booth, ratio: number): BoothImg; //# sourceMappingURL=loadBoothsImages.d.ts.map