import type { CellValue, UnionValue } from '../../treb-base-types/src/index'; export declare const DAY_MS: number; export declare const IsArrayOrTypedArray: (test: unknown) => boolean; export declare const Transpose2: (arr: T[][]) => T[][]; export declare const TransposeArray: (arr: T[][]) => T[][]; export declare const StringToColumn: (s: string) => number; export declare const ColumnToString: (column: number) => string; export declare const OffsetFormula: (formula: string, offset: { columns: number; rows: number; }) => string; /** * assuming boxed (union) arguments, return a flat list of values. * @param args */ export declare const FlattenBoxed: (args: UnionValue[]) => UnionValue[]; /** * specialization using the CellValue type. this should be preferable * to using any, although we're still kind of hacking at it. also we * need to allow typed arrays (I think we've mostly gotten those out?) */ export declare const FlattenCellValues: (args: (CellValue | CellValue[] | CellValue[][] | Float32Array | Float64Array)[], keep_undefined?: boolean) => CellValue[]; /** * flatten cell values, and filter out any non-numbers. this version does * not account for booleans (you might want TRUE = 1). we do this a lot so * combining the two operations seems like a useful place to reuse code. */ export declare const FlattenNumbers: (args: Parameters[0]) => number[]; export declare const FilterIntrinsics: (data: unknown[], fill?: boolean) => (string | number | boolean | undefined)[]; /** * this is an attempt at a generalized array application wrapper * for functions. the rules are the same -- we apply functions pairwise * (or tuple-wise), not combinatorially. * * we could simplify a bit if we require that functions used boxed * values. we should do that anyway, and be consistent across functions. * also we could get the `any`s out. * * (swapping param order, so we don't have hanging param after inline * function definition -- shades of window.setTimeout) * * @param map - a list of parameters, by index, that can be unrolled. this * allows us to support both out-of-order application and functions that take * mixes of scalars and arrays. * * @param base - the underlying function. for any parameters that can * be applied/unrolled, it should take a scalar. * */ export declare const ApplyArrayX: UnionValue>(map: boolean[], base: TFunc) => (...args: Parameters) => UnionValue; /** * parse a string with wildcards into a regex pattern * * from * https://exceljet.net/glossary/wildcard * * Excel has 3 wildcards you can use in your formulas: * * Asterisk (*) - zero or more characters * Question mark (?) - any one character * Tilde (~) - escape for literal character (~*) a literal question mark (~?), or a literal tilde (~~) * * they're pretty liberal with escaping, nothing is an error, just roll with it * */ export declare const ParseWildcards: (text: string) => string; export declare const StringUnion: (value: string) => UnionValue; export declare const NumberUnion: (value: number) => UnionValue;