-
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
[TypeScript] Updated existing and added additional TypeScript definitions #666
Conversation
…ions - [added] TS def for `EuiFieldText` - [added] TS def for `EuiTextArea` - [added] TS def for `EuiHorizontalRule` - [updated] TS def for `EuiIcon` - [added] TS def for `EuiLoadingKibana` - [added] TS def for `EuiModal` (and co.) - [added] TS def for `EuiOverlayMask` - [added] TS def for `EuiPage` (and co.)
id?: string; | ||
placeholder?: string; | ||
value?: string; | ||
defaultValue?: 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.
The props name
, id
, placeholder
, value
and defaultValue
are already part of React.InputHTMLAttributes<HTMLInputElement>
.
fullWidth?: boolean; | ||
onChange?: (event: any) => void; | ||
value?: string; | ||
defaultValue?: 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.
The properties id
, name
, placeholder
, rows
, onChange
, value
and defaultValue
are already defined in TextareaHTMLAttributes<HTMLTextAreaElement>
.
} | ||
|
||
export const EuiTextArea: SFC< | ||
CommonProps & TextareaHTMLAttributes & EuiTextAreaProps |
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.
It seems that TextareaHTMLAttributes
requires an argument (HTMLTextAreaElement
in this case).
export type EuiHorizontalRuleMargin = 'none' | 'xs' | 's' | 'm' | 'l' | 'xl' | 'xxl'; | ||
|
||
export interface EuiHorizontalRuleProps { | ||
children?: ReactNode; |
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.
children
is already defined in DOMAttributes<T>
, which is extended by HTMLAttributes<T>
.
|
||
declare module '@elastic/eui' { | ||
|
||
import { HTMLAttributes } from 'react'; |
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.
Imports in module augmentations are not allowed. `HTMLAttributes' is already being imported in line 3.
*/ | ||
|
||
export interface EuiPageContentBodyProps { | ||
children?: ReactNode; |
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.
This property is already defined in DOMAttributes
.
*/ | ||
|
||
export interface EuiPageContentHeaderProps { | ||
children?: ReactNode; |
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.
This property is already defined in DOMAttributes
.
*/ | ||
|
||
export interface EuiPageContentHeaderSectionProps { | ||
children?: ReactNode; |
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.
This property is already defined in DOMAttributes
.
*/ | ||
|
||
export interface EuiPageSideBarProps { | ||
children?: ReactNode; |
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.
This property is already defined in DOMAttributes
.
} | ||
|
||
export const EuiPageContent: SFC< | ||
CommonProps & EuiPanelProps & EuiPageContentProps |
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.
This requires a /// <reference path="../panel/index.d.ts" />
at the top.
EuiFieldText
EuiTextArea
EuiHorizontalRule
EuiIcon
EuiLoadingKibana
EuiModal
(and co.)EuiOverlayMask
EuiPage
(and co.)