mirror of https://github.com/abpframework/abp.git
1 changed files with 14 additions and 0 deletions
@ -1,2 +1,16 @@ |
|||
// Omissible (given keys will become optional)
|
|||
export type Omissible<T, K extends keyof T> = Partial<Pick<T, K>> & Omit<T, K>; |
|||
|
|||
// ExcludeKeys (keys will be excluded based on their type)
|
|||
type ExcludeKeys<Type, Excluded> = Exclude< |
|||
{ |
|||
[Key in keyof Type]: Type[Key] extends Excluded ? never : Key; |
|||
}[keyof Type], |
|||
never |
|||
>; |
|||
|
|||
// tslint:disable-next-line: ban-types
|
|||
type ExcludeMethods<Type> = Pick<Type, ExcludeKeys<Type, Function>>; |
|||
|
|||
// Options (methods will be omitted, given keys will become optional)
|
|||
export type Options<T, K extends keyof ExcludeMethods<T>> = Omissible<ExcludeMethods<T>, K>; |
|||
|
|||
Loading…
Reference in new issue