import type { Complex } from '../../treb-base-types/src/index'; import { ValueType } from '../../treb-base-types/src/index'; /** * this is code that was in the old number format class, which was superceded * by the new treb-format module. we still need to do rough value parsing, * which is separate from parsing and from formatting. * * cleaning up to remove redundant bits, move inference in here * * FIXME: move this somewhere else, this is the format library */ export interface Hints { Nan?: boolean; Exponential?: boolean; Percent?: boolean; Currency?: boolean; Grouping?: boolean; Parens?: boolean; Date?: boolean; Time?: boolean; } /** * parse result now uses base valuetype */ export interface ParseResult { value: number | string | boolean | undefined | Complex; hints?: Hints; type: ValueType; } /** * value parser class is a singleton, instance is exported */ declare class ValueParserType { compare_day?: Record; compare_month?: Record; TestDate(text: string): number | false; /** * parse a string. if it can reasonably be converted to a number, * do that and return the number; otherwise return the original * string. we also return hints as to formatting, which the caller * may use to select a number format. * * remind me why this is better than just using a parser? (...) */ TryParse(text?: string): ParseResult; } export declare const ValueParser: ValueParserType; export {};