diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2017-09-08 04:13:01 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2017-09-08 04:13:01 +0900 |
| commit | 3feeaccf5955ebf17c26ccc06f32bb39624b89f6 (patch) | |
| tree | fa5d7ee54ba77dcc76ff3cae1d6791dcae499f92 /src/utils | |
| parent | wip dark (diff) | |
| download | sharkey-3feeaccf5955ebf17c26ccc06f32bb39624b89f6.tar.gz sharkey-3feeaccf5955ebf17c26ccc06f32bb39624b89f6.tar.bz2 sharkey-3feeaccf5955ebf17c26ccc06f32bb39624b89f6.zip | |
Add type definition
Diffstat (limited to 'src/utils')
| -rw-r--r-- | src/utils/type.ts | 3 |
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] }; |