import * as Result from "./utility/result.js"; export type XYShape = { readonly xs: number[]; readonly ys: number[]; }; export type XYShapeError = { tag: "NotSorted"; property: string; } | { tag: "IsEmpty"; property: string; } | { tag: "NotFinite"; property: string; value: number; } | { tag: "DifferentLengths"; p1Name: string; p2Name: string; p1Length: number; p2Length: number; } | { tag: "MultipleErrors"; errors: XYShapeError[]; }; export declare const XYShapeError: { mapErrorArrayToError(errors: XYShapeError[]): XYShapeError | undefined; toString(t: XYShapeError): string; }; export type InterpolationStrategy = "Stepwise" | "Linear"; type ExtrapolationStrategy = "UseZero" | "UseOutermostPoints"; type Interpolator = (shape: XYShape, leftIndex: number, x: number) => number; export declare const T: { length(t: XYShape): number; empty: XYShape; isEmpty(t: XYShape): boolean; minX(t: XYShape): number; maxX(t: XYShape): number; firstY(t: XYShape): number; lastY(t: XYShape): number; xTotalRange(t: XYShape): number; mapX(t: XYShape, fn: (x: number) => number): XYShape; mapY(t: XYShape, fn: (y: number) => number): XYShape; mapYResult(t: XYShape, fn: (y: number) => Result.result): Result.result; square(t: XYShape): XYShape; zip({ xs, ys }: XYShape): [number, number][]; fromArray([xs, ys]: [number[], number[]]): XYShape; fromArrays(xs: number[], ys: number[]): XYShape; accumulateYs(p: XYShape, fn: (y1: number, y2: number) => number): XYShape; concat(t1: XYShape, t2: XYShape): XYShape; isEqual(t1: XYShape, t2: XYShape): boolean; fromZippedArray(pairs: readonly [number, number][]): XYShape; equallyDividedXs(t: XYShape, newLength: number): number[]; Validator: { notSortedError(p: string): XYShapeError; notFiniteError(p: string, exampleValue: number): XYShapeError; isEmptyError(propertyName: string): XYShapeError; differentLengthsError(t: XYShape): XYShapeError; areXsSorted(t: XYShape): boolean; areXsEmpty(t: XYShape): boolean; getNonFiniteXs(t: XYShape): number | undefined; getNonFiniteYs(t: XYShape): number | undefined; validate(t: XYShape): XYShapeError | undefined; }; make(xs: number[], ys: number[]): Result.result; makeFromZipped(values: readonly (readonly [number, number])[]): Result.result; removeConsecutiveDuplicates(shape: XYShape): XYShape; }; export declare const YtoX: { linear(t: XYShape, y: number): number; }; export declare const XtoY: { stepwiseIncremental(t: XYShape, x: number): number | undefined; stepwiseIfAtX(t: XYShape, f: number): number | undefined; linear(t: XYShape, x: number): number; continuousInterpolator(interpolation: InterpolationStrategy, extrapolation: ExtrapolationStrategy): Interpolator; }; export declare const XsConversion: { _replaceWithXs(newXs: number[], t: XYShape): XYShape; equallyDivideXByMass(integral: XYShape, newLength: number): number[]; proportionEquallyOverX(t: XYShape, newLength: number): XYShape; proportionByProbabilityMass(t: XYShape, newLength: number, integral: XYShape): XYShape; }; type Zipped = [number, number][]; export declare const Zipped: { sortByY(t: Zipped): [number, number][]; sortByX(t: Zipped): [number, number][]; filterByX(t: Zipped, testFn: (x: number) => boolean): [number, number][]; }; export declare const PointwiseCombination: { combine(interpolator: Interpolator, fn: (a: number, b: number) => Result.result, t1: XYShape, t2: XYShape): Result.result; combineDiscrete(fn: (a: number, b: number) => Result.result, t1: XYShape, t2: XYShape): Result.result; addCombine(interpolator: Interpolator, t1: XYShape, t2: XYShape): XYShape; }; export declare const Range: { integrateWithTriangles({ xs, ys }: XYShape): { xs: number[]; ys: number[]; }; stepwiseToLinear({ xs, ys }: XYShape): XYShape; }; export declare const Analysis: { getVarianceDangerously(t: T, mean: (t: T) => number, getMeanOfSquares: (t: T) => number): number; }; type XYShapeSubset = { points: [number, number][]; segments: XYShape[]; }; type ComparisonType = "greaterThan" | "lesserThan" | "equals" | "greaterThanOrEqual" | "lessThanOrEqual"; export declare const extractSubsetThatSatisfiesThreshold: (shape: XYShape, comparisonType: ComparisonType, threshold: number) => XYShapeSubset; export {}; //# sourceMappingURL=XYShape.d.ts.map