/** * PixelGrid: a picture written as text, one glyph per pixel, compiled into the * ordinary `draw` ops Aseprite already executes. * * It is the writable half of `look op="ascii"`. A model is far better at * laying out a silhouette it can see as rows of characters than at composing * it from ellipse/rect/line calls whose result it cannot see until afterwards, * so the grid is the authoring format and this file does the rasterising — * deterministically, in code, where an off-by-one is a test failure instead of * a misplaced limb. * * Expansion happens here, server-side, like `text`: the Lua extension never * learns a new op, and the same compiler serves the live window and headless. */ export declare const TRANSPARENT_GLYPH = "."; /** The sprite's canvas. A grid may be as large as it and no larger. */ export interface CanvasSize { width: number; height: number; } export interface GridOp { x: number; y: number; /** glyph → colour; null is transparent. "." is transparent unless redefined. */ legend: Record; rows: string[]; /** What transparent cells do: "erase" clears them, "skip" leaves the pixel underneath. */ transparent: "erase" | "skip"; } export interface CompiledGrid { /** Wire ops for draw.batch: `clear` rectangles first, then one `pixels` op per colour. */ ops: Record[]; width: number; height: number; painted: number; erased: number; } export declare function compileGrid(op: GridOp, canvas: CanvasSize): CompiledGrid;