import { Dispatch, SetStateAction } from 'react'; import { SortByProps } from '../components/SortColumn/SortColumn'; export declare const capitalize: (string: string) => string; export declare const hasValue: (item: unknown) => boolean; export declare const notEmpty: (item: unknown) => boolean; export declare const trimText: (text: string | undefined, characterLength: number) => string; export declare const debounce: (callback: (...args: T) => PromiseLike | U, wait: number) => VoidFunction; export type ActiveCellClassProps = { /** activeName - The key that is active for sorting */ activeName: string; /** cells - A single key OR an array of keys that contain the keys for a column cell */ cells: string | string[]; /** color - If you want a background color other than light-blue. * To use this, you need to create a style in _table.module.scss * and pass that class name in as the string */ color?: string; }; export declare const activeCellClass: ({ cells, activeName, color, }: ActiveCellClassProps) => string; export type HasStickyColumnStyleProps = { /** The column index position */ colIndex: number; /** Total number of columns */ tableHeadersLength: number; /** The number of sticky left columns */ stickyLeftColumn?: number; /** The number of sticky right columns */ stickyRightColumn?: number; /** Boolean value to determine if we want to show sticky borders (For left and right sticky columns) */ isRowScrollable?: boolean; }; export declare const hasStickyColumnStyle: ({ colIndex, stickyLeftColumn, stickyRightColumn, tableHeadersLength, }: HasStickyColumnStyleProps) => string; export declare const getStickyColumnBdrStyle: ({ colIndex, stickyLeftColumn, stickyRightColumn, tableHeadersLength, isRowScrollable, }: HasStickyColumnStyleProps) => string; /** * List of columns that have string to be sorted, ex: ['seller_name', 'marketplace']; * Pattern has determined that alpha-numeric values be sorted opposite to convention so that `desc` is A-Z, 0-9 and `asc` is 9-0, Z-A **/ type ColumnsWithStringArray = string[]; /** string format: `prop:value` or `prop:value:lowercase` */ type ParamString = string; export declare const standardSortParams: (sortBy: SortByProps, columnsWithStrings?: ColumnsWithStringArray) => ParamString; export declare const largeNumConversion: (num?: string | number) => { val: number; suffix?: string; }; export declare const snakeCaseToTitle: (string: string) => string; export declare const DEBOUNCE_STANDARD_TIME = 250; export declare const replaceDelimiter: ({ text, joinOption, splitSymbol, keepCasing, }: { text: string; joinOption?: string | null; splitSymbol?: string | null; keepCasing?: boolean; }) => string; /** * Aggregates values from an object array with optional divisor and formatting */ export declare const reduceAndOrAverage: (arr: T[], prop: keyof T, totalToDivideBy?: number | null, extras?: { round?: boolean; floor?: boolean; prefix?: string; suffix?: string; percentage?: boolean; thousandSeparator?: boolean; toFixed?: number; }) => string; type ErrorCallback = ((value: T) => void) | Dispatch> | unknown; /** * Checks HTTP error codes and returns appropriate error messages through a callback * @param errorCode - HTTP status code * @param callback - Function to handle the error message * @param value - Optional custom error message */ export declare const errorCheck: (errorCode: number | undefined, callback: ErrorCallback, value?: string) => void; export declare const aggregateDataValues: (data: T[], propName: keyof T) => number | null; /** @deprecated - This function is not helpful and is misleading as it does not have any currency logic associated with it. It would be more helpful to have this function along with the ability to format the value with currency code and symbol. */ export declare const currencyFormat: (value: number | undefined, toFixed?: number) => string; export declare const sortByProperty: (data: T[], property: keyof T, isDescending?: boolean) => T[]; export type ParsedSymbology = { symbology: string; value: string; }; /** * Strips a scanner symbology prefix from a scanned string and returns the prefix * and the remaining value separately. Returns `null` if no prefix is present. * * Supported prefix formats: * - `]` + 2 chars — AIM bracket identifier (e.g. `]C1`) * - `~P` + 2 chars — tilde-P extended prefix (e.g. `~P12`) * - `~` + 1 char — short tilde prefix (e.g. `~A`, `~K`) */ export declare function parseSymbology(value: string): ParsedSymbology | null; export {};