how to remove properties via mapped type in TypeScript
TS 4.1 You can use as clauses in mapped types to filter out properties in one go: type Methods<T> = { [P in keyof T as T[P] extends Function ? P : never]: T[P] }; type A_Methods = Methods<A>; // { render: () => void; } When the type specified in an as clause resolves … Read more