@procore/core-react
Version:
React library of Procore Design Guidelines
57 lines (56 loc) • 3.61 kB
TypeScript
import type { NumberOptions } from '@procore/globalization-toolkit';
import { NumberFormatter } from '@procore/globalization-toolkit';
import type { CursorPosition, FillDecimalScaleVariant, InputValue, Locale, ParsedInputValue, PressedKey, Separators } from './NumberInput.types';
export declare const defaultLocale = "en-US";
export declare const minus = "-";
export declare const emptyString = "";
export declare const leftBrace = "(";
export declare const rightBrace = ")";
export declare const backspaceKey = "Backspace";
export declare const deleteKey = "Delete";
export declare const numericKeypadDel = "Del";
export declare const periodKey = ".";
export declare const numericKeypadDecimal = "Decimal";
export declare const numericKeypadKey = "Del";
export declare const androidUnidentifiedKey = "Unidentified";
export declare const maxDigitLength = 15;
export declare const maxDecimalScale: number;
export declare const commaKey = ",";
export declare const metaKeyIdentifier = "Meta";
export declare const controlKey = "Control";
export declare const highlightAllKey = "a";
export declare const copyKey = "c";
export declare function toFixed(value: number, precision: number): number;
export declare function formatterFactory(options: NumberOptions): NumberFormatter;
export declare function getSeparators(locale: Locale): Separators;
export declare const isValidNegative: (value: InputValue) => boolean;
export declare function verifyDecimalScale(decimalScale: boolean | number): number;
export declare function unformat(locale: Locale, value: InputValue, isNumericString?: boolean): ParsedInputValue;
export declare function refineIntegerFromLeadingZeroes(integer: string): string;
export declare function getLengthInfo(locale: Locale, value: InputValue, decimalScale?: number, fillDecimalScale?: FillDecimalScaleVariant, isNumericString?: boolean): {
length: number;
safeLength: number;
isSafeLength: boolean;
safelyTruncatedValue: string;
integerLength: number;
safeIntegerLength: number;
isSafeIntegerLength: boolean;
fractionLength: number;
safeFractionLength: number;
isSafeFractionLength: boolean;
};
export declare function format(locale: Locale, decimalScale: number, fillDecimalScale: FillDecimalScaleVariant, value: InputValue, isNumericString?: boolean): string;
export declare function identifyPressedKey(decimalSeparatorKey: string, inputType: string, pressedKey: PressedKey, prevValue: string, value: string): PressedKey;
export declare function getPressedKeyInfo(decimalSeparatorKey: string, group: string, pressedKey: PressedKey, prevCursorPosition: CursorPosition, prevValue: string, verifiedDecimalScale: number): {
backspaceWasPressed: boolean;
backspacedChar: string | null;
decimalWasPressed: boolean;
decimalPressedForInteger: boolean;
deleteWasPressed: boolean;
deletedChar: string | null;
thousandsSeparatorWasBackspaced: boolean;
thousandsSeparatorWasDeleted: boolean;
};
export declare function prepareValueToFormatting(decimal: string, decimalSeparatorKey: string, group: string, pressedKey: PressedKey, prevCursorPosition: CursorPosition, prevValue: string, verifiedDecimalScale: number, value: string): string;
export declare function getNewCursorPosition(decimal: string, decimalSeparatorKey: string, group: string, newValue: string, pressedKey: PressedKey, prevCursorPosition: CursorPosition, prevValue: string, value: string, verifiedDecimalScale: number, locale: Locale, fillDecimalScale: FillDecimalScaleVariant): number;
export declare function identicalLocales(one: Locale, two: Locale): boolean;