import { GpuFragmentParams, KitTexture } from '../../contract'; /** Where a slot's raster sits, in atlas UV: left, top, width, height. Zero size = nothing. */ export type AtlasRect = [number, number, number, number]; export interface GlyphAtlasSlot { /** Show the top-left `width`×`height` of `source` (white glyphs on transparent). */ set(source: HTMLCanvasElement, width: number, height: number): void; /** Show nothing. */ clear(): void; } export interface GlyphAtlas { readonly kit: KitTexture; /** A slot for one layer's raster; `onRect` hears where it sits whenever that changes. */ slot(onRect: (rect: AtlasRect) => void): GlyphAtlasSlot; } /** The composition's glyph atlas (created on first use, shared by every caller). */ export declare function glyphAtlasFor(params: GpuFragmentParams): GlyphAtlas; /** * Shelf-pack slots (tallest first) into the narrowest power-of-two width that keeps the atlas * roughly square. Returns null when they can't fit within `maxAxis`. */ export declare function packSlots(sizes: Array<{ w: number; h: number; }>, maxAxis: number): { width: number; height: number; positions: Array<{ x: number; y: number; }>; } | null; //# sourceMappingURL=glyphAtlas.d.ts.map