export type CSSFilter = { filter: string; html?: string; }; export declare enum Effects { sepia = "sepia", grayscale = "grayscale", natural = "natural", warm = "warm", cold = "cold", temperature = "temperature", contrast = "contrast", shadows = "shadows", white = "white", black = "black", vibrance = "vibrance", saturation = "saturation" } export declare function shapeFilterToCSS(filter: Effects, intensity?: number): CSSFilter | null; /** * Whether this element's CSS `blur()` may be clipped to its element box. * * CSS `blur()` spreads past the element and konva's does not, so an unclipped * chain paints ink the canvas never draws. Clipping is only safe where the * element's ink IS its box, and an exporter cannot measure ink the way konva's * `node.cache()` does — so the types above are the ones where that holds by * construction. `image`/`svg`/`video`/`gif` paint a source scaled INTO the box, * the family the canvas blurs through `applyFiltersToCanvas`, which bakes the * blur into the source bitmap. `figure` paints a path inside the box and * strokes it CLIPPED TO THAT PATH (`figure-to-svg.ts`), whatever the subType. * * Everything else is excluded because its ink genuinely leaves the box: a * `line` draws heads reaching twice the element height past it, `text` at * `lineHeight < 1` draws above and below, and `group`/`table` hold children of * unknown extent. Clipping those DELETES ink — a blurred line lost both arrow * heads outright. * * Only `blur()` needs this. The colour filters are per-pixel, and a * `drop-shadow` is SUPPOSED to leave the box, so it belongs outside the clip. */ export declare function shouldClipBlurToBox(element: { type?: string; blurEnabled?: boolean; blurRadius: number; width: number; height: number; cropWidth?: number; cropHeight?: number; }): boolean; /** * The on-page direction of an element's shadow, expressed in the element's * LOCAL space. * * Konva paints shadows in page space — canvas 2D shadow offsets ignore the * node's transform — so on the canvas a rotated element's shadow keeps its * on-page direction. CSS `drop-shadow`/`text-shadow` and the PDF placement * are painted in the element's local space and then rotated with it, so they * must counter-rotate the model offsets to land in the same page direction. */ export declare function localShadowOffset(element: { shadowOffsetX: number; shadowOffsetY: number; rotation?: number; }): { x: number; y: number; }; /** * A text element with a background box casts ONE shadow, from the box — the * same meaning an element shadow has on an image, svg or figure, and what a * filled text box does in Keynote, PowerPoint or a Figma frame. The glyphs * cast their own shadow only when there is no box. */ export declare function shadowCastByBackground(element: { type?: string; backgroundEnabled?: boolean; }): boolean; /** * The element's full CSS filter chain, mirroring the canvas renderer: * blur/brightness/sepia/grayscale, then the named effects (`element.filters`), * then the drop-shadow. `additionalHTML` carries the inline `` * markup some named effects need (html-export injects it verbatim; * svg-export rewraps the `` root as `` since svg can't nest). * * Shadow parity notes: `shadowBlur / 2` because CSS drop-shadow's blur radius * semantics differ from konva's (halving matches the canvas visually), and * `shadowOpacity` is folded into the shadow color — konva applies it as a * separate multiplier, CSS has no such knob. * * The chain comes back in two halves, because they belong on different nodes * once `blur()` is in play: `boxFilters` has to be clipped to the element box * or the blur paints outside it (`shouldClipBlurToBox`), while `spreadFilters` * — the drop-shadow — is supposed to leave the box. A caller with nothing to * clip concatenates them onto one node. */ export declare function getElementCssFilters(element: { blurEnabled?: boolean; blurRadius: number; brightnessEnabled?: boolean; brightness: number; sepiaEnabled?: boolean; grayscaleEnabled?: boolean; filters?: Record; shadowEnabled?: boolean; shadowOffsetX: number; shadowOffsetY: number; shadowBlur: number; shadowColor: string; shadowOpacity?: number; rotation?: number; type?: string; backgroundEnabled?: boolean; width: number; height: number; cropWidth?: number; cropHeight?: number; }): { boxFilters: string[]; spreadFilters: string[]; /** The drop-shadow when the text background box casts it (see * `shadowCastByBackground`); `spreadFilters` is empty then. */ backgroundFilters: string[]; additionalHTML: string[]; }; export declare function getEffectiveBlurRadius(blurRadius: number, width: number, height: number): number; export declare function getElementBlurRadius(element: { blurRadius: number; width: number; height: number; cropWidth?: number; cropHeight?: number; }): number;