/** A cubic Bézier: anchor 0, control 0, control 1, anchor 1 */ type Cubic = readonly [ number, number, number, number, number, number, number, number ]; /** A 2D point */ type Point = readonly [ number, number ]; declare const DISTANCE_EPSILON = 0.0001; declare const lerp: (start: number, stop: number, fraction: number) => number; declare const distance: (x: number, y: number) => number; declare const direction: (x: number, y: number) => Point; declare const rotate90: ([x, y]: Point) => Point; declare const dot: (a: Point, b: Point) => number; /** A straight segment expressed as a cubic */ declare const straightLine: (x0: number, y0: number, x1: number, y1: number) => Cubic; /** A circular arc from (x0, y0) to (x1, y1) around (centerX, centerY), approximated by one cubic; the arc must be under 180 degrees. */ declare const circularArc: (centerX: number, centerY: number, x0: number, y0: number, x1: number, y1: number) => Cubic; declare const pointOnCurve: (c: Cubic, t: number) => Point; /** Splits a cubic at `t` into two that together trace it (de Casteljau) */ declare const splitCubic: (c: Cubic, t: number) => [ Cubic, Cubic ]; declare const reverseCubic: (c: Cubic) => Cubic; declare const zeroLength: (c: Cubic) => boolean; type PointTransformer = (x: number, y: number) => Point; declare const transformCubic: (c: Cubic, f: PointTransformer) => Cubic; /** The bounding box of a cubic as [left, top, right, bottom]. */ declare const cubicBounds: (c: Cubic) => [ number, number, number, number ]; /** Circle */ declare const shapeCircle: () => RoundedPolygon; /** A rounded square */ declare const shapeSquare: () => RoundedPolygon; /** A slanted square */ declare const shapeSlanted: () => RoundedPolygon; /** An arch */ declare const shapeArch: () => RoundedPolygon; /** A fan */ declare const shapeFan: () => RoundedPolygon; /** An arrow */ declare const shapeArrow: () => RoundedPolygon; /** A semicircle */ declare const shapeSemiCircle: () => RoundedPolygon; /** An oval */ declare const shapeOval: () => RoundedPolygon; /** A pill */ declare const shapePill: () => RoundedPolygon; /** A triangle */ declare const shapeTriangle: () => RoundedPolygon; /** A diamond */ declare const shapeDiamond: () => RoundedPolygon; /** A clam shell */ declare const shapeClamShell: () => RoundedPolygon; /** A pentagon */ declare const shapePentagon: () => RoundedPolygon; /** A gem */ declare const shapeGem: () => RoundedPolygon; /** A sunny shape: an 8-point star */ declare const shapeSunny: () => RoundedPolygon; /** A very sunny shape */ declare const shapeVerySunny: () => RoundedPolygon; /** A 4-sided cookie */ declare const shapeCookie4Sided: () => RoundedPolygon; /** A 6-sided cookie */ declare const shapeCookie6Sided: () => RoundedPolygon; /** A 7-sided cookie */ declare const shapeCookie7Sided: () => RoundedPolygon; /** A 9-sided cookie */ declare const shapeCookie9Sided: () => RoundedPolygon; /** A 12-sided cookie */ declare const shapeCookie12Sided: () => RoundedPolygon; /** A ghost-ish shape */ declare const shapeGhostish: () => RoundedPolygon; /** A 4-leaf clover */ declare const shapeClover4Leaf: () => RoundedPolygon; /** An 8-leaf clover */ declare const shapeClover8Leaf: () => RoundedPolygon; /** A burst */ declare const shapeBurst: () => RoundedPolygon; /** A soft burst */ declare const shapeSoftBurst: () => RoundedPolygon; /** A boom */ declare const shapeBoom: () => RoundedPolygon; /** A soft boom */ declare const shapeSoftBoom: () => RoundedPolygon; /** A flower */ declare const shapeFlower: () => RoundedPolygon; /** A puffy shape */ declare const shapePuffy: () => RoundedPolygon; /** A puffy diamond */ declare const shapePuffyDiamond: () => RoundedPolygon; /** A pixelated circle */ declare const shapePixelCircle: () => RoundedPolygon; /** A pixelated triangle */ declare const shapePixelTriangle: () => RoundedPolygon; /** A bun */ declare const shapeBun: () => RoundedPolygon; /** A heart */ declare const shapeHeart: () => RoundedPolygon; declare const byName: { circle: () => RoundedPolygon; square: () => RoundedPolygon; slanted: () => RoundedPolygon; arch: () => RoundedPolygon; fan: () => RoundedPolygon; arrow: () => RoundedPolygon; semiCircle: () => RoundedPolygon; oval: () => RoundedPolygon; pill: () => RoundedPolygon; triangle: () => RoundedPolygon; diamond: () => RoundedPolygon; clamShell: () => RoundedPolygon; pentagon: () => RoundedPolygon; gem: () => RoundedPolygon; sunny: () => RoundedPolygon; verySunny: () => RoundedPolygon; cookie4Sided: () => RoundedPolygon; cookie6Sided: () => RoundedPolygon; cookie7Sided: () => RoundedPolygon; cookie9Sided: () => RoundedPolygon; cookie12Sided: () => RoundedPolygon; ghostish: () => RoundedPolygon; clover4Leaf: () => RoundedPolygon; clover8Leaf: () => RoundedPolygon; burst: () => RoundedPolygon; softBurst: () => RoundedPolygon; boom: () => RoundedPolygon; softBoom: () => RoundedPolygon; flower: () => RoundedPolygon; puffy: () => RoundedPolygon; puffyDiamond: () => RoundedPolygon; pixelCircle: () => RoundedPolygon; pixelTriangle: () => RoundedPolygon; bun: () => RoundedPolygon; heart: () => RoundedPolygon; }; /** Names of the Material shapes: Compose's, camelCased. */ type MaterialShapeName = keyof typeof byName; /** A Material shape by name, normalised into the unit square. */ declare const materialShape: (name: MaterialShapeName) => RoundedPolygon; /** A polygon's outline as an SVG path ("M … C … Z"), scaled by `size`: a normalised shape fills a `size` × `size` box. */ declare const polygonPath: (polygon: RoundedPolygon, size?: number) => string; /** A Material shape as an SVG path in a `size` × `size` box. */ declare const materialShapePath: (name: MaterialShapeName, size?: number) => string; /** A shape's outline as radii at evenly spaced angles around its centre */ interface RadialProfile { /** Radius at angle i * 2π / radii.length, clockwise from the positive x axis on a y-down canvas */ radii: Float32Array; /** The area centroid the radii are measured from */ centerX: number; centerY: number; /** The largest radius, for fitting the shape into a circle */ maxRadius: number; } declare const sampleProfile: (polygon: RoundedPolygon, samples?: number, stepsPerCubic?: number) => RadialProfile; /** Samples the outline at `samples` angles around the shape's area centroid. */ declare const radialProfile: (polygon: RoundedPolygon, samples?: number, stepsPerCubic?: number) => RadialProfile; /** How a vertex is rounded: the radius, and how much the curve is smoothed into the sides (0–1) */ interface CornerRounding { radius: number; smoothing?: number; } declare const UNROUNDED: CornerRounding; /** A closed shape made of contiguous cubics */ interface RoundedPolygon { cubics: Cubic[]; centerX: number; centerY: number; } /** Builds a rounded polygon from a flat list of vertex coordinates [x0, y0, x1, y1, ...], a rounding for every vertex or one per vertex, and an optional centre (the vertices' centroid by default). */ declare const roundedPolygon: (vertices: number[], rounding?: CornerRounding, perVertexRounding?: CornerRounding[], centerX?: number, centerY?: number) => RoundedPolygon; /** A regular polygon, first vertex at angle 0 */ declare const regularPolygon: (numVertices: number, radius?: number, centerX?: number, centerY?: number, rounding?: CornerRounding, perVertexRounding?: CornerRounding[]) => RoundedPolygon; /** A circle approximated by a fully rounded polygon */ declare const circle: (numVertices?: number, radius?: number, centerX?: number, centerY?: number) => RoundedPolygon; /** A star with `numVerticesPerRadius` outer and inner vertices, outer first at angle 0 */ declare const star: (numVerticesPerRadius: number, radius?: number, innerRadius?: number, rounding?: CornerRounding, innerRounding?: CornerRounding, perVertexRounding?: CornerRounding[], centerX?: number, centerY?: number) => RoundedPolygon; /** A rectangle centred on (centerX, centerY), its first vertex at the bottom right (graphics-shapes rectangle) */ declare const rectangle: (width?: number, height?: number, rounding?: CornerRounding, perVertexRounding?: CornerRounding[], centerX?: number, centerY?: number) => RoundedPolygon; declare const transformPolygon: (polygon: RoundedPolygon, f: PointTransformer) => RoundedPolygon; /** Rotation about the origin, in degrees, positive clockwise on a y-down canvas */ declare const rotatePolygon: (polygon: RoundedPolygon, degrees: number) => RoundedPolygon; declare const scalePolygon: (polygon: RoundedPolygon, sx: number, sy?: number) => RoundedPolygon; /** Bounding box [left, top, right, bottom] from the hull of anchors and controls */ declare const polygonBounds: (polygon: RoundedPolygon) => [ number, number, number, number ]; /** The farthest any anchor or curve midpoint gets from the centre */ declare const polygonMaxRadius: (polygon: RoundedPolygon) => number; /** Fits the shape into the unit square, centred, keeping its aspect ratio */ declare const normalizePolygon: (polygon: RoundedPolygon) => RoundedPolygon; export type { CornerRounding, Cubic, MaterialShapeName, Point, PointTransformer, RadialProfile, RoundedPolygon }; export { UNROUNDED, circle, circularArc, cubicBounds, materialShape, materialShapePath, normalizePolygon, pointOnCurve, polygonBounds, polygonMaxRadius, polygonPath, radialProfile, rectangle, regularPolygon, rotatePolygon, roundedPolygon, scalePolygon, shapeArch, shapeArrow, shapeBoom, shapeBun, shapeBurst, shapeCircle, shapeClamShell, shapeClover4Leaf, shapeClover8Leaf, shapeCookie12Sided, shapeCookie4Sided, shapeCookie6Sided, shapeCookie7Sided, shapeCookie9Sided, shapeDiamond, shapeFan, shapeFlower, shapeGem, shapeGhostish, shapeHeart, shapeOval, shapePentagon, shapePill, shapePixelCircle, shapePixelTriangle, shapePuffy, shapePuffyDiamond, shapeSemiCircle, shapeSlanted, shapeSoftBoom, shapeSoftBurst, shapeSquare, shapeSunny, shapeTriangle, shapeVerySunny, splitCubic, star, straightLine, transformPolygon };