Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use more complete implementation of Omit in TypeScript definitions #322

Merged
merged 3 commits into from
Jan 26, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
**Bug fixes**

- Set `EuiFlexGroup` to `flex-grow: 1` to be more friendly with IE11 [(#315)](https://github.com/elastic/eui/pull/315)
- Fix TypeScript definitions such that optional and readonly properties survive being passed through `Omit` [(#322)](https://github.com/elastic/eui/pull/322)

# [`0.0.13`](https://github.com/elastic/eui/tree/v0.0.13)

Expand Down
2 changes: 1 addition & 1 deletion src/components/common.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ declare module '@elastic/eui' {
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> = { [P in Diff<keyof T, K>]: T[P] };
type Omit<T, K extends keyof T> = Pick<T, Diff<keyof T, K>>;
}
14 changes: 6 additions & 8 deletions src/components/context_menu/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,11 @@ declare module '@elastic/eui' {
content?: React.ReactNode;
}

export interface EuiContextMenuProps {
panels?: EuiContextMenuPanelDescriptor[];
initialPanelId?: EuiContextMenuPanelId;
}
export type EuiContextMenuProps = CommonProps &
Omit<HTMLAttributes<HTMLDivElement>, 'style'> & {
panels?: EuiContextMenuPanelDescriptor[];
initialPanelId?: EuiContextMenuPanelId;
};

export const EuiContextMenu: SFC<
Omit<HTMLAttributes<HTMLDivElement>, 'className' | 'style'> &
EuiContextMenuProps
>;
export const EuiContextMenu: SFC<EuiContextMenuProps>;
}