// eslint-disable-next-line @typescript-eslint/no-explicit-any export type OmitFunctionsAndKeysAndReadOnly = { [P in Exclude< keyof T, K | FunctionPropertyNames | ReadOnlyPropertyNames >]: T[P]; }; type FunctionPropertyNames = { // eslint-disable-next-line @typescript-eslint/ban-types [K in keyof T]: T[K] extends Function ? K : never; }[keyof T]; type ReadOnlyPropertyNames = { [K in keyof T]: IfEquals< { [P in K]: T[K] }, { -readonly [P in K]: T[K] }, never, K >; }[keyof T]; type IfEquals = (() => T extends X ? 1 : 2) extends () => T extends Y ? 1 : 2 ? A : B;