Add type definition
This commit is contained in:
parent
bc23ec0a95
commit
3feeaccf59
4 changed files with 57 additions and 4 deletions
3
src/utils/type.ts
Normal file
3
src/utils/type.ts
Normal file
|
|
@ -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] };
|
||||
Loading…
Add table
Add a link
Reference in a new issue