declarative-js
Version:
_declarative-js_ is modern JavaScript library, that helps to: - tackle array transformation with built in JavaScript array api (e.g. `array.filter(toBe.unique())`), - provide a type-level solution for representing optional values instead of null referen
14 lines (13 loc) • 644 B
TypeScript
import { MethodMap } from './map/MethodMap';
export interface StringMap<T> {
[keyof: string]: T;
}
export declare type AutoComparable = string | number;
export declare type Getter<C, R> = (cbv: C) => R;
export declare type KeyGetter<C> = Getter<C, string>;
export declare type Predicate<T> = (value: T) => boolean;
export declare const Map: <T>(obj?: StringMap<T> | undefined) => MethodMap<T>;
export declare type AlwaysArray<T> = T extends any[] ? T : T[];
export declare type NonNull<R> = R extends undefined | null ? R : R;
export declare type Tuple<E1, E2> = [E1, E2];
export declare type Consumer<T> = (value: T) => void;