-
Notifications
You must be signed in to change notification settings - Fork 842
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
TypeScript definition changes (#1247)
* TypeScript definition changes Add definitions for `EuiAccordion`, `EuiDescriptionList`, `EuiForm`, `EuiFormHelpText` and the accessibility services, and fix a number of small TS issues. * Fix EuiCheckbox TS def
- Loading branch information
1 parent
e318d6c
commit a397d61
Showing
14 changed files
with
103 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { HTMLAttributes, Component, ReactNode } from 'react'; | ||
|
||
declare module '@elastic/eui' { | ||
export type EuiAccordionSize = 'none' | 'xs' | 's' | 'm' | 'l' | 'xl'; | ||
|
||
export interface EuiAccordionProps { | ||
id: string; | ||
buttonContentClassName?: string; | ||
buttonContent?: ReactNode; | ||
extraAction?: ReactNode; | ||
initialIsOpen?: boolean; | ||
paddingSize?: EuiAccordionSize; | ||
} | ||
|
||
export class EuiAccordion extends Component< | ||
CommonProps & HTMLAttributes<HTMLDivElement> & EuiAccordionProps | ||
> {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { HTMLAttributes, Component, ReactNode } from 'react'; | ||
|
||
declare module '@elastic/eui' { | ||
export type EuiDescriptionListType = 'row' | 'column' | 'inline'; | ||
export type EuiDescriptionListAlignment = 'center' | 'left'; | ||
export type EuiDescriptionListTextStyle = 'normal' | 'reverse'; | ||
|
||
export interface EuiDescriptionListProps { | ||
listItems?: Array<{ title: ReactNode, description: ReactNode }>; | ||
align?: EuiDescriptionListAlignment; | ||
compressed?: boolean; | ||
textStyle?: EuiDescriptionListTextStyle; | ||
type?: EuiDescriptionListType; | ||
} | ||
|
||
export class EuiDescriptionList extends Component< | ||
CommonProps & HTMLAttributes<HTMLDListElement> & EuiDescriptionListProps | ||
> {} | ||
|
||
export interface EuiDescriptionListTitleProps {} | ||
|
||
export class EuiDescriptionListTitle extends Component< | ||
CommonProps & HTMLAttributes<HTMLElement> & EuiDescriptionListTitleProps | ||
> {} | ||
|
||
export interface EuiDescriptionListDescriptionProps {} | ||
|
||
export class EuiDescriptionListDescription extends Component< | ||
CommonProps & HTMLAttributes<HTMLElement> & EuiDescriptionListDescriptionProps | ||
> {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/// <reference path="../../common.d.ts" /> | ||
/// <reference path="../../icon/index.d.ts" /> | ||
|
||
import { ReactNode, SFC, HTMLAttributes } from 'react'; | ||
|
||
declare module '@elastic/eui' { | ||
|
||
/** | ||
* @see './field_help_text.js' | ||
*/ | ||
export interface EuiFormHelpTextProps { | ||
} | ||
|
||
export const EuiFormHelpText: SFC< | ||
CommonProps & HTMLAttributes<HTMLDivElement> & EuiFormHelpTextProps | ||
>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,27 @@ | ||
/// <reference path="../common.d.ts" /> | ||
/// <reference path="./checkbox/index.d.ts" /> | ||
/// <reference path="./field_number/index.d.ts" /> | ||
/// <reference path="./field_search/index.d.ts" /> | ||
/// <reference path="./field_text/index.d.ts" /> | ||
/// <reference path="./form_help_text/index.d.ts" /> | ||
/// <reference path="./form_label/index.d.ts" /> | ||
/// <reference path="./form_row/index.d.ts" /> | ||
/// <reference path="./radio/index.d.ts" /> | ||
/// <reference path="./select/index.d.ts" /> | ||
/// <reference path="./switch/index.d.ts" /> | ||
/// <reference path="./text_area/index.d.ts" /> | ||
|
||
import { SFC, FormHTMLAttributes, ReactNode } from 'react'; | ||
|
||
declare module '@elastic/eui' { | ||
/** | ||
* @see './form.js' | ||
*/ | ||
export type EuiFormProps = CommonProps & | ||
FormHTMLAttributes<HTMLFormElement> & { | ||
isInvalid?: boolean; | ||
error?: ReactNode | ReactNode[]; | ||
}; | ||
|
||
export const EuiForm: SFC<EuiFormProps>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
declare module '@elastic/eui' { | ||
export const accessibleClickKeys: { [keyCode: number]: string }; | ||
export const cascadingMenuKeyCodes: { [keyCodeName: string]: keyCodes }; | ||
export const comboBoxKeyCodes: { [keyCodeName: string]: keyCodes }; | ||
export const htmlIdGenerator: (prefix?: string) => (suffix?: string) => string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters