Skip to content

Commit

Permalink
Rename generic type parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
CvX committed Mar 13, 2019
1 parent 85275d4 commit 7cd2c33
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ type SystemMessages = {
const messages: RequireAtLeastOne<SystemMessages, 'macos' | 'linux' | 'windows'> = {macos: 'hey', default: 'hello'};
```
*/
export type RequireAtLeastOne<T, Keys extends keyof T = keyof T> =
Omit<T, Keys>
export type RequireAtLeastOne<ObjectType, KeysType extends keyof ObjectType = keyof ObjectType> =
Omit<ObjectType, KeysType>
& {
[Key in Keys]-?: Required<Pick<T, Key>>
}[Keys];
[Key in KeysType]-?: Required<Pick<ObjectType, Key>>
}[KeysType];

0 comments on commit 7cd2c33

Please sign in to comment.