@expofp/floorplan
Version:
Interactive floor plan library for expos and events
44 lines • 2.09 kB
TypeScript
/**
* TEMPORARY dev logging + console playground — DELETE this file together with
* its import in `load.ts`.
*
* Logs the effective config and the eagerly-loaded `fp.svg.js` payload while
* `pnpm dev:floorplan` runs. The lazy parts (layer `$ref`s — js evaluated to
* json by `@expofp/resolve` — and other data files) load only when called from
* the console. None of this feeds the app: `resolve()` evaluates scripts into
* a sandbox, so `window.__fp*` and the script-tag loader stay untouched.
*
* Play with it from the console:
*
* __efpDev.config // frozen effective config
* __efpDev.fpSvgJs // evaluated fp.svg.js payload
* __efpDev.refs // layer name -> { $ref }
* __efpDev.layers // resolved payloads so far
* await __efpDev.loadLayer('Venue') // resolve one layer by name
* await __efpDev.loadLayers() // resolve every layer ref
* await __efpDev.loadDataFile('wf.data.js') // any file next to fp.svg.js
* await __efpDev.loadDataFile('booths.json')
* await __efpDev.resolve({ $ref: 'https://…/fp.svg.js' }) // raw resolve, js or json
*/
import { type Config } from '@expofp/config';
import { resolve } from '@expofp/resolve';
import { type FpSvgJs, type FpSvgLayerJs, type FpSvgLayerJsRef } from '@expofp/schema';
interface EfpDevPlayground {
config: Config;
fpSvgJs: FpSvgJs;
refs: Record<string, FpSvgLayerJsRef>;
layers: Record<string, FpSvgLayerJs>;
loadLayer: (name: string) => Promise<FpSvgLayerJs | undefined>;
loadLayers: () => Promise<Record<string, FpSvgLayerJs>>;
loadDataFile: <T = unknown>(fileName: string) => Promise<T>;
resolve: typeof resolve;
}
declare global {
interface Window {
/** @deprecated temporary dev playground, see `load-dev.ts` */
__efpDev?: EfpDevPlayground;
}
}
export declare function initLoadDev(config: Config): void;
export {};
//# sourceMappingURL=load-dev.d.ts.map