import type { DimensionValue } from "react-native"; export type TNumericTextOptions = { allowDecimal: boolean; allowNegative: boolean; }; export type TResolveNumberOptions = { min?: number; max?: number; decimals?: number; }; export type TStepNumberOptions = TResolveNumberOptions & { value: number; step: number; direction: -1 | 1; }; /** * Whether a runtime value is a finite JavaScript number. */ export declare const isFiniteNumber: (value: unknown) => value is number; /** * Whether a runtime value is a finite, non-negative number. * * Useful for cosmetic native metrics such as size, radius, thickness * and dimensions where negative values are not meaningful. */ export declare const isNonNegativeFiniteNumber: (value: unknown) => value is number; /** * Resolves a finite numeric metric or falls back to a safe value. * * Negative values remain valid because some metrics, such as angles or * offsets, legitimately support them. */ export declare const resolveFiniteMetric: (value: number | undefined, fallback: number) => number; /** * Resolves a finite, non-negative numeric metric or falls back safely. */ export declare const resolveNonNegativeMetric: (value: number | undefined, fallback: number) => number; /** * Resolves a finite, non-negative integer or falls back safely. * * Useful for counts and other discrete configuration values. */ export declare const resolveNonNegativeInteger: (value: number | undefined, fallback: number) => number; /** * Resolves a finite positive integer with a minimum value of 1. * * Useful for visible-item counts and other configurations where zero * would make the component structurally unusable. */ export declare const resolvePositiveInteger: (value: number | undefined, fallback: number) => number; /** * Preserves valid native DimensionValue inputs while protecting numeric * dimensions from negative, NaN and infinite values. * * Non-numeric native values such as percentages are passed through unchanged. */ export declare const resolveDimension: (value: DimensionValue | undefined, fallback: DimensionValue) => DimensionValue; /** * Parses a percentage string into its numeric 0–100 representation. * * Returns null when the input is not a finite percentage between 0 and 100. */ export declare const parsePercentage: (value: string) => number | null; /** * Normalizes the decimal separator accepted by numeric text parsing. * * The rendered editing text is intentionally left untouched so consumers can * type either "." or "," naturally. This normalization is only for parsing. */ export declare const normalizeNumericText: (text: string) => string; /** * Whether a string can still become a valid numeric value while the user is * editing. * * Temporary states such as "", "-", ".", "-.", "12." and "12," are allowed * when their corresponding numeric features are enabled. */ export declare const isPotentialNumericText: (text: string, { allowDecimal, allowNegative }: TNumericTextOptions) => boolean; /** * Parses only complete numeric editing states. * * Temporary states intentionally return null and therefore do not emit a * semantic numeric value. */ export declare const parseNumericText: (text: string, options: TNumericTextOptions) => number | null; /** * Applies ARCUI numeric precision semantics. * * decimals=undefined means integer-only. */ export declare const normalizeNumberPrecision: (value: number, decimals?: number) => number; export declare const clampNumber: (value: number, min?: number, max?: number) => number; /** * Normalizes precision first and then applies the configured numeric bounds. */ export declare const resolveNumberValue: (value: number, { min, max, decimals }: TResolveNumberOptions) => number; /** * Resolves one semantic step without exposing floating-point artifacts such as * 0.1 + 0.2 = 0.30000000000000004. */ export declare const stepNumber: ({ value, step, direction, min, max, decimals, }: TStepNumberOptions) => number; /** * Formats the non-editing representation. * * When decimals is explicitly supplied, trailing zeroes are intentional. */ export declare const formatNumber: (value: number, decimals?: number) => string;