-
Notifications
You must be signed in to change notification settings - Fork 842
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
[types/toast] add types for EuiToast, EuiGlobalToastList(Item) #1045
Conversation
jenkins test this |
src/components/toast/index.d.ts
Outdated
* @see './global_toast_list.js' | ||
*/ | ||
export interface Toast extends Omit<EuiToastProps, 'id'> { | ||
id: string | number, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is the reason for allowing number
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's the implementation in Kibana, id is an auto-incrementing number, so I figured since it's supported it should be documented/typed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible/easy to toString
that value here? id
as a string isn't valid as it is applied to the toast's div
, and as we typescript out EUI further this will require a code change to EuiGlobalToastList
to correctly support the id
attribute as a specific case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, it's all in one location so it won't be hard to fix in Kibana.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typedefs LGTM
Adds types for the
<EuiToast />
,<EuiGlobalToastList />
, and<EuiGlobalToastListItem />
components.