UNPKG

@expofp/floorplan

Version:

Interactive floor plan library for expos and events

38 lines • 1.97 kB
import { type Booth } from '../../../../store/BoothStore'; import { type Exhibitor } from '../../../../store/ExhibitorStore'; /** One booth logo, ready to draw. */ export interface BoothLogo { /** The bytes the renderer packs. An SVG logo is rasterized and re-encoded as PNG. */ blob: Blob; /** The logo's width divided by its height, which is what fits it inside the booth. */ aspectRatio: number; } /** * The exhibitor whose logo is painted in this booth, if any. * * One function, so the logo URL and the stated ratio always come off the same exhibitor. A booth * can hold several. * @param booth - The booth to look at. * @returns The exhibitor, or undefined when no exhibitor in the booth wants its logo painted. */ export declare function boothLogoExhibitor(booth: Booth): Exhibitor | undefined; /** * The logo aspect ratio the event data states for this booth, when it states a usable one. * * A value that is not a finite positive number is not a ratio. It would mis-fit the logo in every * booth the exhibitor holds, and nothing downstream would catch it, so it is rejected here and the * caller measures the pixels instead. * @param booth - The booth whose logo is being placed. * @returns The ratio, or undefined when the data states none that can be used. */ export declare function statedLogoAspectRatio(booth: Booth): number | undefined; /** * Makes the logo preparer for one batch of booths. * * The preparer answers two questions per booth: which bytes the renderer packs, and at what ratio * the logo is fitted. It holds the batch's two caches, which is why it is built per batch rather * than imported: booths share logos, and both answers must be shared with them. * @returns A function preparing one booth's logo. It returns null when the logo cannot be drawn. */ export declare function createLogoPreparer(): (booth: Booth, blob: Blob) => Promise<BoothLogo | null>; //# sourceMappingURL=booth-logos.d.ts.map