/** * Remove the readonly flag from all properties in T */ export type Writable = { -readonly [K in keyof T]: T[K]; }; /** * Get all keys in T whose value is of type K */ export type KeysByType = { [P in keyof T as T[P] extends K ? P : never]: T[P]; };