-
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.
Add typescript definitions for more components (#326)
- Loading branch information
1 parent
60453d4
commit 7f182fe
Showing
10 changed files
with
136 additions
and
2 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,21 @@ | ||
/// <reference path="../../common.d.ts" /> | ||
|
||
import { SFC, ReactNode, HTMLAttributes } from 'react'; | ||
|
||
declare module '@elastic/eui' { | ||
/** | ||
* @see './form_row.js' | ||
*/ | ||
|
||
export type EuiFormRowProps = CommonProps & | ||
HTMLAttributes<HTMLDivElement> & { | ||
error?: string | string[]; | ||
fullWidth?: boolean; | ||
hasEmptyLabelSpace?: boolean; | ||
helpText?: ReactNode; | ||
isInvalid?: boolean; | ||
label?: ReactNode; | ||
}; | ||
|
||
export const EuiFormRow: SFC<EuiFormRowProps>; | ||
} |
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,2 +1,5 @@ | ||
/// <reference path="./checkbox/index.d.ts" /> | ||
/// <reference path="./field_search/index.d.ts" /> | ||
/// <reference path="./form_row/index.d.ts" /> | ||
/// <reference path="./radio/index.d.ts" /> | ||
/// <reference path="./switch/index.d.ts" /> |
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,26 @@ | ||
/// <reference path="../../common.d.ts" /> | ||
|
||
import { SFC, HTMLAttributes, ReactNode } from 'react'; | ||
|
||
declare module '@elastic/eui' { | ||
/** | ||
* @see './radio_group.js' | ||
*/ | ||
export interface EuiRadioGroupOption { | ||
id: string; | ||
label?: ReactNode; | ||
} | ||
|
||
export type EuiRadioGroupChangeCallback = (id: string) => void; | ||
|
||
export type EuiRadioGroupProps = CommonProps & | ||
Omit<HTMLAttributes<HTMLDivElement>, 'onChange'> & { | ||
options?: EuiRadioGroupOption[]; | ||
idSelected?: string; | ||
onChange: EuiRadioGroupChangeCallback; | ||
}; | ||
|
||
export type x = EuiRadioGroupProps['onChange']; | ||
|
||
export const EuiRadioGroup: SFC<EuiRadioGroupProps>; | ||
} |
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 @@ | ||
/// <reference path="../../common.d.ts" /> | ||
|
||
import { SFC, InputHTMLAttributes, ReactNode } from 'react'; | ||
|
||
declare module '@elastic/eui' { | ||
/** | ||
* @see './switch.js' | ||
*/ | ||
export type EuiSwitchChangeCallback = (state: boolean) => void; | ||
|
||
export type EuiSwitchProps = CommonProps & | ||
Omit<InputHTMLAttributes<HTMLInputElement>, 'onChange'> & { | ||
label?: ReactNode; | ||
onChange?: EuiSwitchChangeCallback; | ||
}; | ||
|
||
export const EuiSwitch: SFC<EuiSwitchProps>; | ||
} |
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,30 @@ | ||
/// <reference path="../common.d.ts" /> | ||
|
||
import { SFC, HTMLAttributes } from 'react'; | ||
|
||
declare module '@elastic/eui' { | ||
/** | ||
* @see './loading_spinner.js' | ||
*/ | ||
export type EuiLoadingSpinnerSize = 's' | 'm' | 'l' | 'xl'; | ||
|
||
export type EuiLoadingSpinnerProps = CommonProps & | ||
HTMLAttributes<HTMLDivElement> & { | ||
size?: EuiLoadingSpinnerSize; | ||
}; | ||
|
||
export const EuiLoadingSpinner: SFC<EuiLoadingSpinnerProps>; | ||
|
||
/** | ||
* @see './loading_chart.js' | ||
*/ | ||
export type EuiLoadingChartSize = 'm' | 'l' | 'xl'; | ||
|
||
export type EuiLoadingChartProps = CommonProps & | ||
HTMLAttributes<HTMLDivElement> & { | ||
mono?: boolean; | ||
size?: EuiLoadingChartSize; | ||
}; | ||
|
||
export const EuiLoadingChart: SFC<EuiLoadingChartProps>; | ||
} |
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,29 @@ | ||
/// <reference path="../common.d.ts" /> | ||
|
||
import { SFC, HTMLAttributes } from 'react'; | ||
|
||
declare module '@elastic/eui' { | ||
/** | ||
* @see './progress.js' | ||
*/ | ||
export type EuiProgressColor = | ||
| 'accent' | ||
| 'danger' | ||
| 'primary' | ||
| 'secondary' | ||
| 'subdued'; | ||
|
||
export type EuiProgressSize = 'xs' | 's' | 'm' | 'l'; | ||
|
||
export type EuiProgressPosition = 'fixed' | 'absolute' | 'static'; | ||
|
||
export type EuiProgressProps = CommonProps & | ||
HTMLAttributes<HTMLProgressElement> & { | ||
size?: EuiProgressSize; | ||
color?: EuiProgressColor; | ||
position?: EuiProgressPosition; | ||
max?: number; | ||
}; | ||
|
||
export const EuiProgress: SFC<EuiProgressProps>; | ||
} |
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