We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
OmitFunctionMembers
1 parent 0d3cdd7 commit 13fd2fcCopy full SHA for 13fd2fc
packages/js-utils/src/types/public/helper-types.ts
@@ -1,3 +1,4 @@
1
+/* eslint-disable @typescript-eslint/ban-types */
2
/**
3
* A type that extracts the optional properties from another type.
4
*/
@@ -10,3 +11,10 @@ export type OptionalProperties<T> = {
10
11
12
// eslint-disable-next-line @typescript-eslint/no-explicit-any
13
export type Constructor<T = any> = new (...args: any[]) => T;
14
+
15
+/**
16
+ * Creates a subsidiary type that omits all function members from a given type.
17
+ */
18
+export type OmitFunctionMembers<T> = {
19
+ [K in keyof T as T[K] extends Function ? never : K]: T[K];
20
+};
0 commit comments