UNPKG

map-fns

Version:

<h1 align="center"> <code>map-fns</code> </h1>

14 lines (13 loc) 451 B
declare type Key = string | number; export interface AnyMap { [key: Key]: any; } export interface MapOf<T> { [key: Key]: T; } export declare type ItemInMap<M extends AnyMap, T extends M[keyof M] = M[keyof M]> = T; export declare type FilterType<T, U, K extends keyof T = keyof T> = { [_K in K as T[_K] extends U ? _K : never]: T[_K]; }; export declare type KeysOfFilteredType<T, U> = keyof FilterType<T, U> & (string | number); export {};