summaryrefslogtreecommitdiff
path: root/src/utils
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils')
-rw-r--r--src/utils/type.ts3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/utils/type.ts b/src/utils/type.ts
new file mode 100644
index 0000000000..ba6ea0be77
--- /dev/null
+++ b/src/utils/type.ts
@@ -0,0 +1,3 @@
+// https://github.com/Microsoft/TypeScript/issues/12215
+export type Diff<T extends string, U extends string> = ({ [P in T]: P } & { [P in U]: never } & { [x: string]: never })[T];
+export type Omit<T, K extends keyof T> = { [P in Diff<keyof T, K>]: T[P] };