Skip to content

Commit

Permalink
Make the Omit type compatible with TS 2.9+ (#1017)
Browse files Browse the repository at this point in the history
  • Loading branch information
weltenwort authored Jul 16, 2018
1 parent 3f0e2eb commit b8064e0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## [`master`](https://github.com/elastic/eui/tree/master)

- Added typings for `EuiEmptyPrompt`, `EuiCode`, `EuiCodeBlock`, and `EuiCallOut` ([#1010](https://github.com/elastic/eui/pull/1010))
- Make utility type `Omit` compatible with new `keyof` behaviour introduced in TypeScript 2.9 ([#1017](https://github.com/elastic/eui/pull/1017))

**Bug fixes**

Expand Down
5 changes: 1 addition & 4 deletions src/components/common.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,5 @@ declare module '@elastic/eui' {

// utility types:

type Diff<T extends string, U extends string> = ({ [P in T]: P } &
{ [P in U]: never } & { [x: string]: never })[T];

type Omit<T, K extends keyof T> = Pick<T, Diff<keyof T, K>>;
type Omit<T, K> = Pick<T, Exclude<keyof T, K>>;
}

0 comments on commit b8064e0

Please sign in to comment.