/** * 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 */ 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]; };