Skip to content

Commit

Permalink
chore(typings): update TypeScript and use tslint-config-airbnb (#2942)
Browse files Browse the repository at this point in the history
  • Loading branch information
layershifter authored Jun 23, 2018
1 parent 1f01e14 commit caee404
Show file tree
Hide file tree
Showing 214 changed files with 3,511 additions and 2,994 deletions.
454 changes: 227 additions & 227 deletions index.d.ts

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,9 @@
"sinon-chai": "^3.1.0",
"ta-scripts": "^2.5.2",
"through2": "^2.0.3",
"tslint": "^5.6.0",
"tslint-config-typings": "^0.3.1",
"typescript": "^2.4.2",
"tslint": "^5.10.0",
"tslint-config-airbnb": "^5.9.2",
"typescript": "^2.9.2",
"vinyl": "^2.1.0",
"webpack": "^3.5.4",
"webpack-dev-middleware": "^1.12.0",
Expand Down
34 changes: 17 additions & 17 deletions src/addons/Confirm/Confirm.d.ts
Original file line number Diff line number Diff line change
@@ -1,49 +1,49 @@
import * as React from 'react';
import * as React from 'react'

import { SemanticShorthandItem } from '../..';
import { ButtonProps } from '../../elements/Button';
import { ModalProps } from '../../modules/Modal';
import { ModalContentProps } from '../../modules/Modal/ModalContent';
import { ModalHeaderProps } from '../../modules/Modal/ModalHeader';
import { SemanticShorthandItem } from '../..'
import { ButtonProps } from '../../elements/Button'
import { ModalProps } from '../../modules/Modal'
import { ModalContentProps } from '../../modules/Modal/ModalContent'
import { ModalHeaderProps } from '../../modules/Modal/ModalHeader'

export interface ConfirmProps extends ModalProps {
[key: string]: any;
[key: string]: any

/** The cancel button text. */
cancelButton?: SemanticShorthandItem<ButtonProps>;
cancelButton?: SemanticShorthandItem<ButtonProps>

/** The OK button text. */
confirmButton?: SemanticShorthandItem<ButtonProps>;
confirmButton?: SemanticShorthandItem<ButtonProps>

/** The ModalContent text. */
content?: SemanticShorthandItem<ModalContentProps>;
content?: SemanticShorthandItem<ModalContentProps>

/** The ModalHeader text. */
header?: SemanticShorthandItem<ModalHeaderProps>;
header?: SemanticShorthandItem<ModalHeaderProps>

/**
* Called when the Modal is closed without clicking confirm.
*
* @param {SyntheticEvent} event - React's original SyntheticEvent.
* @param {object} data - All props.
*/
onCancel?: (event: React.MouseEvent<HTMLAnchorElement>, data: ConfirmProps) => void;
onCancel?: (event: React.MouseEvent<HTMLAnchorElement>, data: ConfirmProps) => void

/**
* Called when the OK button is clicked.
*
* @param {SyntheticEvent} event - React's original SyntheticEvent.
* @param {object} data - All props.
*/
onConfirm?: (event: React.MouseEvent<HTMLAnchorElement>, data: ConfirmProps) => void;
onConfirm?: (event: React.MouseEvent<HTMLAnchorElement>, data: ConfirmProps) => void

/** Whether or not the modal is visible. */
open?: boolean;
open?: boolean

/** A confirm can vary in size. */
size?: 'fullscreen' | 'large' | 'mini' | 'small' | 'tiny';
size?: 'fullscreen' | 'large' | 'mini' | 'small' | 'tiny'
}

declare const Confirm: React.ComponentClass<ConfirmProps>;
declare const Confirm: React.ComponentClass<ConfirmProps>

export default Confirm;
export default Confirm
2 changes: 1 addition & 1 deletion src/addons/Confirm/index.d.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export { default, ConfirmProps } from './Confirm';
export { default, ConfirmProps } from './Confirm'
13 changes: 6 additions & 7 deletions src/addons/MountNode/MountNode.d.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
import * as React from 'react';
import * as React from 'react'

export interface MountNodeProps {
[key: string]: any;
[key: string]: any

/** Additional classes. */
className?: string;
className?: string

/** The DOM node where we will apply class names. Defaults to document.body. */
node?: HTMLElement;
node?: HTMLElement
}

declare class MountNode extends React.Component<MountNodeProps, {}> {
}
declare class MountNode extends React.Component<MountNodeProps, {}> {}

export default MountNode;
export default MountNode
2 changes: 1 addition & 1 deletion src/addons/MountNode/index.d.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export { default, MountNodeProps } from './MountNode';
export { default, MountNodeProps } from './MountNode'
38 changes: 19 additions & 19 deletions src/addons/Pagination/Pagination.d.ts
Original file line number Diff line number Diff line change
@@ -1,58 +1,58 @@
import * as React from 'react';
import * as React from 'react'

import { SemanticShorthandItem } from '../..';
import { default as PaginationItem, PaginationItemProps } from './PaginationItem';
import { SemanticShorthandItem } from '../..'
import { default as PaginationItem, PaginationItemProps } from './PaginationItem'

export interface PaginationProps {
[key: string]: any;
[key: string]: any

/** A pagination item can have an aria label. */
'aria-label'?: string;
'aria-label'?: string

/** Initial activePage value. */
defaultActivePage?: number | string;
defaultActivePage?: number | string

/** Index of the currently active page. */
activePage?: number | string;
activePage?: number | string

/** Number of always visible pages at the beginning and end. */
boundaryRange?: number | string;
boundaryRange?: number | string

/** A shorthand for PaginationItem. */
ellipsisItem?: SemanticShorthandItem<PaginationItemProps>;
ellipsisItem?: SemanticShorthandItem<PaginationItemProps>

/** A shorthand for PaginationItem. */
firstItem?: SemanticShorthandItem<PaginationItemProps>;
firstItem?: SemanticShorthandItem<PaginationItemProps>

/** A shorthand for PaginationItem. */
lastItem?: SemanticShorthandItem<PaginationItemProps>;
lastItem?: SemanticShorthandItem<PaginationItemProps>

/** A shorthand for PaginationItem. */
nextItem?: SemanticShorthandItem<PaginationItemProps>;
nextItem?: SemanticShorthandItem<PaginationItemProps>

/** A shorthand for PaginationItem. */
pageItem?: SemanticShorthandItem<PaginationItemProps>;
pageItem?: SemanticShorthandItem<PaginationItemProps>

/** A shorthand for PaginationItem. */
prevItem?: SemanticShorthandItem<PaginationItemProps>;
prevItem?: SemanticShorthandItem<PaginationItemProps>

/**
* Called on change of an active page.
*
* @param {SyntheticEvent} event - React's original SyntheticEvent.
* @param {object} data - All props.
*/
onPageChange?: (event: React.MouseEvent<HTMLAnchorElement>, data: PaginationProps) => void;
onPageChange?: (event: React.MouseEvent<HTMLAnchorElement>, data: PaginationProps) => void

/** Number of always visible pages before and after the current one. */
siblingRange?: number | string;
siblingRange?: number | string

/** Total number of pages. */
totalPages: number | string;
totalPages: number | string
}

declare class Pagination extends React.Component<PaginationProps, {}> {
static Item: typeof PaginationItem;
static Item: typeof PaginationItem
}

export default Pagination;
export default Pagination
19 changes: 9 additions & 10 deletions src/addons/Pagination/PaginationItem.d.ts
Original file line number Diff line number Diff line change
@@ -1,35 +1,34 @@
import * as React from 'react';
import * as React from 'react'

export interface PaginationItemProps {
[key: string]: any;
[key: string]: any

/** A pagination item can be active. */
active?: boolean;
active?: boolean

/** A pagination item can be disabled. */
disabled?: boolean;
disabled?: boolean

/**
* Called on click.
*
* @param {SyntheticEvent} event - React's original SyntheticEvent.
* @param {object} data - All props.
*/
onClick?: (event: React.MouseEvent<HTMLAnchorElement>, data: PaginationItemProps) => void;
onClick?: (event: React.MouseEvent<HTMLAnchorElement>, data: PaginationItemProps) => void

/**
* Called on key down.
*
* @param {SyntheticEvent} event - React's original SyntheticEvent.
* @param {object} data - All props.
*/
onKeyDown?: (event: React.MouseEvent<HTMLAnchorElement>, data: PaginationItemProps) => void;
onKeyDown?: (event: React.MouseEvent<HTMLAnchorElement>, data: PaginationItemProps) => void

/** A pagination should have a type. */
type?: 'ellipsisItem' | 'firstItem' | 'prevItem' | 'pageItem' | 'nextItem' | 'lastItem';
type?: 'ellipsisItem' | 'firstItem' | 'prevItem' | 'pageItem' | 'nextItem' | 'lastItem'
}

declare class PaginationItem extends React.Component<PaginationItemProps, {}> {
}
declare class PaginationItem extends React.Component<PaginationItemProps, {}> {}

export default PaginationItem;
export default PaginationItem
2 changes: 1 addition & 1 deletion src/addons/Pagination/index.d.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export { default, PaginationProps } from './Pagination';
export { default, PaginationProps } from './Pagination'
58 changes: 29 additions & 29 deletions src/addons/Portal/Portal.d.ts
Original file line number Diff line number Diff line change
@@ -1,113 +1,113 @@
import * as React from 'react';
import * as React from 'react'

export interface PortalProps {
[key: string]: any;
[key: string]: any

/** Primary content. */
children?: React.ReactNode;
children?: React.ReactNode

/** Additional classes. */
className?: string;
className?: string

/** Controls whether or not the portal should close on a click outside. */
closeOnDocumentClick?: boolean;
closeOnDocumentClick?: boolean

/** Controls whether or not the portal should close when escape is pressed is displayed. */
closeOnEscape?: boolean;
closeOnEscape?: boolean

/**
* Controls whether or not the portal should close when mousing out of the portal.
* NOTE: This will prevent `closeOnTriggerMouseLeave` when mousing over the
* gap from the trigger to the portal.
*/
closeOnPortalMouseLeave?: boolean;
closeOnPortalMouseLeave?: boolean

/**
* Controls whether or not the portal should close on a click on the portal background.
* NOTE: This differs from closeOnDocumentClick:
* - DocumentClick - any click not within the portal
* - RootNodeClick - a click not within the portal but within the portal's wrapper
*/
closeOnRootNodeClick?: boolean;
closeOnRootNodeClick?: boolean

/** Controls whether or not the portal should close on blur of the trigger. */
closeOnTriggerBlur?: boolean;
closeOnTriggerBlur?: boolean

/** Controls whether or not the portal should close on click of the trigger. */
closeOnTriggerClick?: boolean;
closeOnTriggerClick?: boolean

/** Controls whether or not the portal should close when mousing out of the trigger. */
closeOnTriggerMouseLeave?: boolean;
closeOnTriggerMouseLeave?: boolean

/** Initial value of open. */
defaultOpen?: boolean;
defaultOpen?: boolean

/** Event pool namespace that is used to handle component events. */
eventPool?: string;
eventPool?: string

/** The node where the portal should mount. */
mountNode?: any;
mountNode?: any

/** Milliseconds to wait before opening on mouse over */
mouseEnterDelay?: number;
mouseEnterDelay?: number

/** Milliseconds to wait before closing on mouse leave */
mouseLeaveDelay?: number;
mouseLeaveDelay?: number

/**
* Called when a close event happens
*
* @param {SyntheticEvent} event - React's original SyntheticEvent.
* @param {object} data - All props.
*/
onClose?: (event: React.MouseEvent<HTMLElement>, data: PortalProps) => void;
onClose?: (event: React.MouseEvent<HTMLElement>, data: PortalProps) => void

/**
* Called when the portal is mounted on the DOM
*
* @param {null}
* @param {object} data - All props.
*/
onMount?: (nothing: null, data: PortalProps) => void;
onMount?: (nothing: null, data: PortalProps) => void

/**
* Called when an open event happens
*
* @param {SyntheticEvent} event - React's original SyntheticEvent.
* @param {object} data - All props.
*/
onOpen?: (event: React.MouseEvent<HTMLElement>, data: PortalProps) => void;
onOpen?: (event: React.MouseEvent<HTMLElement>, data: PortalProps) => void

/**
* Called when the portal is unmounted from the DOM
*
* @param {null}
* @param {object} data - All props.
*/
onUnmount?: (nothing: null, data: PortalProps) => void;
onUnmount?: (nothing: null, data: PortalProps) => void

/** Controls whether or not the portal is displayed. */
open?: boolean;
open?: boolean

/** Controls whether or not the portal should open when the trigger is clicked. */
openOnTriggerClick?: boolean;
openOnTriggerClick?: boolean

/** Controls whether or not the portal should open on focus of the trigger. */
openOnTriggerFocus?: boolean;
openOnTriggerFocus?: boolean

/** Controls whether or not the portal should open when mousing over the trigger. */
openOnTriggerMouseEnter?: boolean;
openOnTriggerMouseEnter?: boolean

/** Controls whether the portal should be prepended to the mountNode instead of appended. */
prepend?: boolean;
prepend?: boolean

/** Any inline styles to the Portal container. */
style?: object;
style?: object

/** Element to be rendered in-place where the portal is defined. */
trigger?: React.ReactNode;
trigger?: React.ReactNode
}

declare const Portal: React.ComponentClass<PortalProps>;
declare const Portal: React.ComponentClass<PortalProps>

export default Portal;
export default Portal
2 changes: 1 addition & 1 deletion src/addons/Portal/index.d.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export { default, PortalProps } from './Portal';
export { default, PortalProps } from './Portal'
Loading

0 comments on commit caee404

Please sign in to comment.