From 2cfa9359077cd66e9010e3c55fcce0313c48c2f3 Mon Sep 17 00:00:00 2001 From: Justin Kambic Date: Thu, 19 Jul 2018 12:10:23 -0400 Subject: [PATCH 1/4] Add typings for EuiBadge. --- CHANGELOG.md | 2 +- src/components/badge/index.d.ts | 23 +++++++++++++++++++++++ src/components/index.d.ts | 1 + 3 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 src/components/badge/index.d.ts diff --git a/CHANGELOG.md b/CHANGELOG.md index 898223a67ec..87a87d1460e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ ## [`master`](https://github.com/elastic/eui/tree/master) -No public interface changes since `3.1.0`. +- Added typings for 'Euibadge' ([]) ## [`3.1.0`](https://github.com/elastic/eui/tree/v3.1.0) diff --git a/src/components/badge/index.d.ts b/src/components/badge/index.d.ts new file mode 100644 index 00000000000..c51823c5782 --- /dev/null +++ b/src/components/badge/index.d.ts @@ -0,0 +1,23 @@ +/// + +import { HTMLAttributes, MouseEventHandler } from 'react'; + +declare module '@elastic/eui' { + + type IconSide = 'left'; + + export interface EuiBadgeProps { + iconType?: IconType; + iconSide?: IconSide; + iconOnClick?: MouseEventHandler; + iconOnClickAriaLabel?: string; + onClick?: MouseEventHandler; + onClickAriaLabel?: string; + color?: string; + closeButtonProps?: Object; + } + + export const EuiBadge: SFC< + CommonProps & HTMLAttributes & EuiBadgeProps + >; +} diff --git a/src/components/index.d.ts b/src/components/index.d.ts index b34302413fa..6a985d717d8 100644 --- a/src/components/index.d.ts +++ b/src/components/index.d.ts @@ -24,3 +24,4 @@ /// /// /// +/// From 118d1bccc039f364d631d2ee20e950b51b840f72 Mon Sep 17 00:00:00 2001 From: Justin Kambic Date: Thu, 19 Jul 2018 13:12:00 -0400 Subject: [PATCH 2/4] Add PR info to CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 87a87d1460e..ce17448880b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ ## [`master`](https://github.com/elastic/eui/tree/master) -- Added typings for 'Euibadge' ([]) +- Added typings for 'Euibadge' ([#1034](https://github.com/elastic/eui/pull/1034)) ## [`3.1.0`](https://github.com/elastic/eui/tree/v3.1.0) From 7b4e8b2421c1d87b61c28e18faa584212229e8c4 Mon Sep 17 00:00:00 2001 From: Justin Kambic Date: Thu, 19 Jul 2018 13:13:03 -0400 Subject: [PATCH 3/4] Fix typo in changelog. --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ce17448880b..58f5dd2a57c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ ## [`master`](https://github.com/elastic/eui/tree/master) -- Added typings for 'Euibadge' ([#1034](https://github.com/elastic/eui/pull/1034)) +- Added typings for 'EuiBadge' ([#1034](https://github.com/elastic/eui/pull/1034)) ## [`3.1.0`](https://github.com/elastic/eui/tree/v3.1.0) From 957240b34dcb0e136b66c3db958f37d4f6f9f848 Mon Sep 17 00:00:00 2001 From: Justin Kambic Date: Thu, 19 Jul 2018 16:02:00 -0400 Subject: [PATCH 4/4] Update EuiBadge SFC annotation based on PR feedback. --- src/components/badge/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/badge/index.d.ts b/src/components/badge/index.d.ts index c51823c5782..a4feee62569 100644 --- a/src/components/badge/index.d.ts +++ b/src/components/badge/index.d.ts @@ -18,6 +18,6 @@ declare module '@elastic/eui' { } export const EuiBadge: SFC< - CommonProps & HTMLAttributes & EuiBadgeProps + CommonProps & HTMLAttributes & HTMLAttributes & EuiBadgeProps >; }