/** * Public API for shape boolean operations on SVG path strings and polygon * arrays. * * Provides {@link unionShapes}, {@link intersectShapes}, * {@link subtractShapes}, {@link fragmentShapes}, {@link combineShapes}, * and the dispatcher {@link mergeShapes}, plus their polygon-array and * SVG-path alias counterparts. * * @module geometry/shape-boolean-ops */ /** * Compute the union of two SVG path shapes. * * Merges the outer boundaries of both shapes into a single path. * For non-overlapping shapes, returns a multi-sub-path result. * * @param paths1 - First SVG path data string. * @param paths2 - Second SVG path data string. * @returns SVG path data string of the union. */ export declare function unionShapes(paths1: string, paths2: string): string; /** * Compute the intersection of two SVG path shapes. * * Keeps only the overlapping region of both shapes. * * @param paths1 - First SVG path data string. * @param paths2 - Second SVG path data string. * @returns SVG path data string of the intersection. */ export declare function intersectShapes(paths1: string, paths2: string): string; /** * Compute the subtraction of two SVG path shapes (paths1 - paths2). * * Removes the overlapping region of paths2 from paths1. * * @param paths1 - Subject SVG path data string. * @param paths2 - Clip SVG path data string to subtract. * @returns SVG path data string of the difference. */ export declare function subtractShapes(paths1: string, paths2: string): string; /** * Fragment two SVG path shapes into non-overlapping pieces. * * Splits the shapes into up to 3 regions: * - Parts of paths1 not overlapping paths2 * - Parts of paths2 not overlapping paths1 * - The overlapping region * * @param paths1 - First SVG path data string. * @param paths2 - Second SVG path data string. * @returns Array of SVG path data strings, one per fragment. */ export declare function fragmentShapes(paths1: string, paths2: string): string[]; /** * Compute the symmetric difference (XOR / Combine) of two SVG path shapes. * * Returns the regions that belong to exactly one of the two shapes, * excluding the overlap. This is the PowerPoint "Combine" operation. * * @param paths1 - First SVG path data string. * @param paths2 - Second SVG path data string. * @returns SVG path data string of the combined (XOR) result. */ export declare function combineShapes(paths1: string, paths2: string): string; /** Supported merge shape operations (matching PowerPoint's Merge Shapes menu). */ export type MergeShapeOperation = 'union' | 'intersect' | 'subtract' | 'fragment' | 'combine'; /** * Apply a merge shape operation to two SVG path strings. * * @param operation - The boolean operation to perform. * @param paths1 - First SVG path data string. * @param paths2 - Second SVG path data string. * @returns Result SVG path string(s). Fragment returns multiple strings; others return one. */ export declare function mergeShapes(operation: MergeShapeOperation, paths1: string, paths2: string): string | string[]; /** * Compute the union of two polygons. * * Merges the outer boundaries of both polygons. For non-overlapping polygons, * returns the concatenation of both polygon point arrays. * * @param poly1 - First polygon as array of [x, y] points. * @param poly2 - Second polygon as array of [x, y] points. * @returns Union polygon(s) as array of [x, y] points. When the union is a * single polygon it is the first (and only) element; disjoint polygons * produce multiple elements which are concatenated into a single flat array. */ export declare function unionPolygons(poly1: number[][], poly2: number[][]): number[][]; /** * Compute the intersection of two polygons. * * Keeps only the overlapping region of both polygons using * Sutherland-Hodgman clipping. * * @param poly1 - First polygon as array of [x, y] points. * @param poly2 - Second polygon as array of [x, y] points. * @returns Intersection polygon as array of [x, y] points, or empty array * if no overlap. */ export declare function intersectPolygons(poly1: number[][], poly2: number[][]): number[][]; /** * Compute the subtraction of two polygons (poly1 - poly2). * * Removes the overlapping region of poly2 from poly1 using * Sutherland-Hodgman clipping. * * @param poly1 - Subject polygon as array of [x, y] points. * @param poly2 - Clip polygon to subtract as array of [x, y] points. * @returns Difference polygon(s) as array of [x, y] points, or empty array * if nothing remains. */ export declare function subtractPolygons(poly1: number[][], poly2: number[][]): number[][]; /** * Compute the union of two SVG path strings. * Alias for {@link unionShapes}. * * @param path1 - First SVG path data string. * @param path2 - Second SVG path data string. * @returns SVG path data string of the union. */ export declare function unionSvgPaths(path1: string, path2: string): string; /** * Compute the intersection of two SVG path strings. * Alias for {@link intersectShapes}. * * @param path1 - First SVG path data string. * @param path2 - Second SVG path data string. * @returns SVG path data string of the intersection. */ export declare function intersectSvgPaths(path1: string, path2: string): string; /** * Compute the subtraction of two SVG path strings (path1 - path2). * Alias for {@link subtractShapes}. * * @param path1 - First SVG path data string. * @param path2 - Second SVG path data string. * @returns SVG path data string of the difference. */ export declare function subtractSvgPaths(path1: string, path2: string): string; //# sourceMappingURL=shape-boolean-ops.d.ts.map