/** * Flips a boolean type */ export type Not = T extends true ? false : true; /** * Just the string portion of `keyof` * * This prevents `keyof` from returning `number | Symbol` keys */ // TODO: improve this to allow for numeric keys, when changing to keyof T & (string | number) some compiler error occurs export type StringKey = keyof T & string; /** * Transforms a complex nested type to a readable type */ export type Unalias = T extends Map ? Map> : T extends Set ? Set> : T extends Date ? T : T extends Array ? Array> : T extends Record ? { [K in keyof T]: Unalias } : T; /** * Transforms a Readonly type to a mutable type */ export type Writeable = { -readonly [P in keyof T]: T[P] };