/** @packageDocumentation * @module CartesianGeometry */ /** * Data carrier for use when repeatedly testing items (of parameterized type T) to determine the one with a minimum associated value. * * Optionally pushes to arrays of items and values when the value does not exceed a given trigger. * * * The item at minimum value is still recorded, even if the minimum value exceeds the trigger value. * * When comparing a potential minimum value to an undefined value, the number is always accepted as the new minimum. * @internal */ export declare class MinimumValueTester { itemAtMinValue: T | undefined; minValue: number | undefined; triggerForSavingToArray: number | undefined; savedItems: T[]; savedValues: number[]; /** * Capture the given item with undefined item and value, and optional maxValueForSavingToArray. */ private constructor(); /** * Static method to create a tester. * @param maxValueForSavingToArray optional numeric value limiting items to save to the optional array. * @returns new tester. */ static create(maxValueForSavingToArray?: number): MinimumValueTester; /** * Install new minimum value and associated item, both possibly undefined. * * The existing arrays of saved items and values, and the trigger value, are unaffected. * @param item object to associate with the new minimum value * @param value new minimum value */ resetMinValueAndItem(item?: T | undefined, value?: number | undefined): void; /** * Set the trigger value. * @param value new trigger value * @param reinitializeArrays whether to clear the arrays of saved items and values */ resetTriggerValueForSavingToArray(value: number | undefined, reinitializeArrays?: boolean): void; /** * Test a new item with value. * * Push the new item and value to the saved arrays if both: * * `this.triggerForSavingToArray` is defined * * the new value is less than or equal to `this.triggerForSavingToArray`. * * Save the new item and value if either: * * `this.minValue` is undefined * * new value is less than `this.minValue`. * @param item item to be saved (captured!) if value conditions are met * @param value numeric value being minimized. * @returns true if and only if the input value is the new minimum value. */ testAndSave(item: T, value: number): boolean; /** Whether the input value is small enough to be saved to this instance. */ doesValueTrigger(value: number): boolean; /** Whether the input value is smaller than the last recorded minimum value. */ isNewMinValue(value: number): boolean; /** Whether the input value is small enough to be the new minimum or to be saved to this instance. */ isNewMinOrTrigger(value: number): boolean; } //# sourceMappingURL=MinimumValueTester.d.ts.map