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

Migrate all the ts things #3

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/components/button/button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,10 @@ type EuiButtonPropsForButton = EuiButtonProps &
buttonRef?: Ref<HTMLButtonElement>;
};

type Props = ExclusiveUnion<EuiButtonPropsForAnchor, EuiButtonPropsForButton>;
export type Props = ExclusiveUnion<
EuiButtonPropsForAnchor,
EuiButtonPropsForButton
>;

export const EuiButton: FunctionComponent<Props> = ({
children,
Expand Down
6 changes: 5 additions & 1 deletion src/components/button/button_group/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
export { EuiButtonGroup } from './button_group';
export {
EuiButtonGroup,
EuiButtonGroupOption,
EuiButtonGroupProps,
} from './button_group';
8 changes: 6 additions & 2 deletions src/components/button/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export { ButtonColor, COLORS, EuiButton } from './button';
export { COLORS, ButtonColor, EuiButton, EuiButtonProps } from './button';

export { EuiButtonEmpty, EuiButtonEmptyProps } from './button_empty';

Expand All @@ -10,4 +10,8 @@ export {

export { EuiButtonToggle } from './button_toggle';

export { EuiButtonGroup } from './button_group';
export {
EuiButtonGroup,
EuiButtonGroupOption,
EuiButtonGroupProps,
} from './button_group';
2 changes: 1 addition & 1 deletion src/components/context_menu/context_menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export type EuiContextMenuPanelItemDescriptor = Omit<
panel?: EuiContextMenuPanelId;
};

interface EuiContextMenuPanelDescriptor {
export interface EuiContextMenuPanelDescriptor {
id: EuiContextMenuPanelId;
title?: string;
items?: EuiContextMenuPanelItemDescriptor[];
Expand Down
16 changes: 13 additions & 3 deletions src/components/context_menu/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
export { EuiContextMenu } from './context_menu';
export {
EuiContextMenu,
EuiContextMenuPanelDescriptor,
EuiContextMenuPanelItemDescriptor,
} from './context_menu';

export { EuiContextMenuPanel } from './context_menu_panel';
export {
EuiContextMenuPanel,
EuiContextMenuPanelProps,
} from './context_menu_panel';

export { EuiContextMenuItem } from './context_menu_item';
export {
EuiContextMenuItem,
EuiContextMenuItemIcon,
} from './context_menu_item';
3 changes: 1 addition & 2 deletions src/components/drag_and_drop/draggable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import React, {
} from 'react';
import { Draggable, DraggableProps } from 'react-beautiful-dnd';
import classNames from 'classnames';
import { CommonProps, Omit, keysOf } from '../common';
import { CommonProps, Omit } from '../common';
import { EuiDroppableContext } from './droppable';

const spacingToClassNameMap = {
Expand All @@ -18,7 +18,6 @@ const spacingToClassNameMap = {
l: 'euiDraggable--l',
};

export const SPACING = keysOf(spacingToClassNameMap);
export type EuiDraggableSpacing = keyof typeof spacingToClassNameMap;

export interface EuiDraggableProps
Expand Down
3 changes: 1 addition & 2 deletions src/components/drag_and_drop/droppable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import React, {
} from 'react';
import { Droppable, DroppableProps } from 'react-beautiful-dnd';
import classNames from 'classnames';
import { CommonProps, Omit, keysOf } from '../common';
import { CommonProps, Omit } from '../common';
import { EuiDragDropContextContext } from './drag_drop_context';

const spacingToClassNameMap = {
Expand All @@ -16,7 +16,6 @@ const spacingToClassNameMap = {
l: 'euiDroppable--l',
};

export const SPACING = keysOf(spacingToClassNameMap);
export type EuiDroppableSpacing = keyof typeof spacingToClassNameMap;

export interface EuiDroppableProps
Expand Down
2 changes: 1 addition & 1 deletion src/components/popover/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export { EuiInputPopover } from './input_popover';
export { EuiPopover, PopoverAnchorPosition } from './popover';
export { EuiPopover, EuiPopoverProps, PopoverAnchorPosition } from './popover';
export { EuiPopoverTitle } from './popover_title';
export { EuiPopoverFooter } from './popover_footer';
export { EuiWrappingPopover } from './wrapping_popover';
4 changes: 3 additions & 1 deletion src/components/popover/popover.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,9 @@ function getElementFromInitialFocus(
return initialFocus as HTMLElement | null;
}

type Props = CommonProps & HTMLAttributes<HTMLDivElement> & EuiPopoverProps;
export type Props = CommonProps &
HTMLAttributes<HTMLDivElement> &
EuiPopoverProps;

interface State {
prevProps: {
Expand Down
4 changes: 2 additions & 2 deletions src/components/popover/wrapping_popover.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React, { Component } from 'react';
import { EuiPopover } from './popover';
import { EuiPopover, Props as EuiPopoverProps } from './popover';
import { EuiPortal } from '../portal';

interface Props {
interface Props extends EuiPopoverProps {
button: HTMLElement;
}

Expand Down
2 changes: 1 addition & 1 deletion src/components/table/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export { EuiTable } from './table';
export { EuiTable, Props as EuiTableProps } from './table';
export { EuiTableBody } from './table_body';
export { EuiTableFooter } from './table_footer';
export { EuiTableFooterCell } from './table_footer_cell';
Expand Down