/** * Adjustment-aware geometry for shapes whose silhouette depends on the * source PPTX's `shapeAdjustments` values. * * The static `PRESET_SHAPE_CLIP_PATHS` table renders every shape at its * default adjustment values. This module supplements that table for the * subset of shapes where ignoring the adjustments produces a visibly wrong * outline (callouts, pies, donuts, block-arcs, etc.). * * Adjustment encodings (per ECMA-376 §20.1.9 / DrawingML preset shapes): * - **Distance** adjustments (`adjN` for callout pointer X/Y, donut hole, * band thickness, arrow head) are stored as 1/100,000ths of the body's * width or height. A pointer X of 25000 means 25% of width. * - **Angle** adjustments (`adjN` for sweep angles on pie/arc/blockArc/ * circularArrow) are stored as 1/60,000ths of a degree. An angle value * of 16,200,000 corresponds to 270°. * * Default adjustment values are sourced from the `avLst` block of each * shape's `presetShapeDefinitions` entry in ECMA-376 Annex E. The defaults * applied here are documented inline. * * The exported {@link getAdjustmentAwareClipPath} returns a CSS * `clip-path` string (always a `polygon(...)` for cross-browser safety — * Firefox <105 lacks `path()` clip-path support). Returns `undefined` * when the shape isn't in the supported set, allowing callers to fall * back to the static preset polygon. * * @module adjustment-aware-shapes */ /** * Convert an OOXML angle adjustment value (60,000ths of a degree) to radians. * Falls back to {@link defaultUnits} when {@link value} is non-finite. */ declare function angleAdjToRadians(value: number | undefined, defaultUnits: number): number; /** * Convert an OOXML distance adjustment value (100,000ths of a fraction) * to a unit fraction in [-2, 2]. Negative or oversized values are clamped * to a sane range that keeps the resulting polygon finite. */ declare function distanceAdjToFraction(value: number | undefined, defaultUnits: number): number; /** Build a polygon clip-path string from a list of [xFrac, yFrac] points. */ declare function polygonFromFractions(points: ReadonlyArray): string; /** * Build a CSS `clip-path` value for {@link shapeType} that incorporates * the supplied `shapeAdjustments`. Returns `undefined` for shapes that * are not in the adjustment-aware table — callers should fall back to * the static preset polygon. * * @param shapeType The OOXML preset geometry name (e.g. `"pie"`). * @param width The element width in pixels. * @param height The element height in pixels. * @param adjustments Optional adjustment record from `PptxElement.shapeAdjustments`. * Keys are `adj`, `adj1`, `adj2`, etc. * @returns A CSS `clip-path` polygon expression, or `undefined`. */ export declare function getAdjustmentAwareClipPath(shapeType: string, width: number, height: number, adjustments?: Record): string | undefined; export declare const _internalForTests: { polygonFromFractions: typeof polygonFromFractions; angleAdjToRadians: typeof angleAdjToRadians; distanceAdjToFraction: typeof distanceAdjToFraction; }; export {}; //# sourceMappingURL=adjustment-aware-shapes.d.ts.map