apphouse
Version:
Component library for React that uses observable state management and theme-able components.
21 lines (20 loc) • 1.1 kB
TypeScript
export declare enum SortByOptions {
state = "state",
label = "label",
calculatedScore = "calculatedScore",
defaultScore = "defaultScore"
}
export declare enum SortByOrderOptions {
ascending = "ascending",
descending = "descending"
}
export declare const sortByCalculatedScore: (a: any, b: any) => number;
export declare const normalizeString: (str: any) => string;
export declare const hasTerm: (term: string, str: string) => boolean;
export declare const sortByDateField: (a: any, b: any, order: any) => 0 | 1 | -1;
export declare const sortByStringField: (a: any, b: any, order: SortByOrderOptions) => number;
export declare const sortByNumberField: (a: any, b: any, order: SortByOrderOptions) => 0 | 1 | -1;
export declare const sortByField: (a: any, b: any, field: any, order: SortByOrderOptions, date?: boolean, forceNumber?: boolean) => number;
export declare const sortByValue: (itemA: any, itemB: any, order: SortByOrderOptions, date?: boolean) => number;
export declare const isString: (value: any) => boolean;
export declare const isNumber: (value: any) => boolean;