guardLayout function
Count layout reads made during a step; the number shows as engine.violations.
export declare function guardLayout(engine: Engine): () => boolean;
DEBUG V0.10.0
fizlet/debugDevelopment-only checks. guardLayout(engine) counts every layout read (rects, offset/client/scroll sizes, computed style) made while the engine is in its STEP phase, the contract's "no layout reads in the tick". Never ship this in a production build.
Measured on this build: minified and gzipped with everything it imports, the way npm run size checks the budget in CI.
import { guardLayout } from "https://coded-dot-design.github.io/fizlet/dist/debug.js";npm install fizlet # not published yet
import { guardLayout } from "fizlet/debug";import { guardLayout } from "fizlet/debug";
guardLayout(e); // dev builds only
e.violations; // layout reads made in a step: 0Every export, with its doc comment, read from the published type declarations of v0.10.0.
guardLayout functionCount layout reads made during a step; the number shows as engine.violations.
export declare function guardLayout(engine: Engine): () => boolean;