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

[TypeScript] Updated existing and added additional TypeScript definitions #666

Merged
merged 1 commit into from
Apr 13, 2018
Merged

[TypeScript] Updated existing and added additional TypeScript definitions #666

merged 1 commit into from
Apr 13, 2018

Conversation

uboness
Copy link
Contributor

@uboness uboness commented Apr 12, 2018

  • [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.)

@uboness uboness requested a review from weltenwort April 12, 2018 16:14
…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.)
@uboness uboness merged commit 0059d47 into elastic:master Apr 13, 2018
id?: string;
placeholder?: string;
value?: string;
defaultValue?: string;
Copy link
Member

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;
Copy link
Member

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
Copy link
Member

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;
Copy link
Member

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';
Copy link
Member

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;
Copy link
Member

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;
Copy link
Member

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;
Copy link
Member

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;
Copy link
Member

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
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants