-
Notifications
You must be signed in to change notification settings - Fork 841
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
Add missing TS defs and fixing existing def #1240
Conversation
Add TypeScript definitions for: - `EuiFormLabel` - `EuiSelect` Fix the `EuiTextColor` definition.
I've added a definition for |
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.
Couple of small changes
* @see './field_number.js' | ||
*/ | ||
export interface EuiFieldNumberProps { | ||
icon?: string; |
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.
should be IconType
imported from EuiIcon
's index.d.ts
*/ | ||
|
||
export type EuiFormLabelProps = CommonProps & | ||
HTMLAttributes<HTMLLabelElement> & { |
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.
LabelHTMLAttributes
instead of HTMLAttributes
, LabelHTMLAttributes<HTMLLabelElement>
*/ | ||
|
||
export type EuiSelectProps = CommonProps & | ||
OptionHTMLAttributes<HTMLSelectElement> & { |
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.
SelectHTMLAttributes
instead of OptionHTMLAttributes
/// <reference path="../../common.d.ts" /> | ||
|
||
import { ReactNode, SFC, InputHTMLAttributes } from 'react'; | ||
import { IconType } from '@elastic/eui' |
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.
Our approach for these is adding a reference to the icon file, e.g. /// <reference path="../icon/index.d.ts" />
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.
changes LGTM!
Add TypeScript definitions for
EuiFormLabel
andEuiSelect
, and fix theEuiTextColor
definition.I skipped the checklist for this PR as this is purely a TS definition change, and has no functional or visual change. I tested the changes during work on migrating a project to TS, which is how I discovered the issue.