UNPKG

chek

Version:

Minimal utility for checking types, working with arrays and objects.

26 lines (25 loc) 884 B
export declare type Transform = (value: any) => any; export interface IMap<T> { [key: string]: T; } export interface IMetadata { [key: string]: any; } export interface IArrayResult { array: any[]; val: any; } export interface IDateFormat extends Intl.DateTimeFormatOptions { locales?: string | string[]; } export declare type IComparator = (a: any, b: any) => number; export declare type IComparatorPrimer = (val: any) => any; export declare type IComparatorOptions = { key: string; primer?: IComparatorPrimer; order?: string | number | boolean; comparator?: IComparator; }; export declare type IComparatorOrder = 'asc' | 'desc' | 'ascending' | 'descending' | 0 | 1 | -1; export declare type IComparatorTuple = [string, IComparatorOrder]; export declare type IComparatorField = (string | IComparatorOptions | IComparatorPrimer | IComparatorTuple);