/** * Mask post-process: emits a mask shape item + component for each layer that * carries `IRMaskData`, propagating the mask reference to the layer's renderer * component or — for parent layers — to descendant renderers. * * The decision to emit (per-layer) is gated solely on `layer.mask != null`, * so any IR producer can opt in by writing the field. Currently only lottie * IR has masks; dsl IR leaves `mask` undefined and this module no-ops for it. * * The lookup callbacks let each pipeline plug in its own layer-to-emitted-id * mapping — lottie keeps `layerToItemId`/`layerToComponentId`/`parentIndexSet` * during emission, dsl tracks differently. Mask handling stays generic. */ import type { IRComposition } from '@vvfx/animation-ir'; import type { ECSCollector, ProcessedItem } from '../types'; /** * Pipeline-specific lookups consumed during mask emission. A pipeline that * never produces masks can pass stub callbacks (the iterator skips layers * without `mask`, so the callbacks are never invoked in that case). */ export interface MaskLayerLookup { getItemId(layerIndex: number): string | undefined; getComponentId(layerIndex: number): string | undefined; isParentLayer(layerIndex: number): boolean; } export declare function applyMasks(ir: IRComposition, collector: ECSCollector, processedItems: ProcessedItem[], ratio: number, width: number, height: number, frameRate: number, lookup: MaskLayerLookup): void;