Skip to content

Commit

Permalink
chore(typings): add strict props (#3107)
Browse files Browse the repository at this point in the history
* add strict props

* fix test

* chore(Item): add types for ItemImage

* chore(typing): add export of FlagStrictProps

* chore(typings): export all definitions

* test(typings): update tests
  • Loading branch information
evollu authored and layershifter committed Sep 17, 2018
1 parent 6d818b5 commit 3e4243a
Show file tree
Hide file tree
Showing 213 changed files with 985 additions and 324 deletions.
477 changes: 394 additions & 83 deletions index.d.ts

Large diffs are not rendered by default.

6 changes: 4 additions & 2 deletions src/addons/Confirm/Confirm.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@ import * as React from 'react'

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

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

export interface StrictConfirmProps extends StrictModalProps {
/** The cancel button text. */
cancelButton?: SemanticShorthandItem<ButtonProps>

Expand Down
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, StrictConfirmProps } from './Confirm'
4 changes: 3 additions & 1 deletion src/addons/MountNode/MountNode.d.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import * as React from 'react'

export interface MountNodeProps {
export interface MountNodeProps extends StrictMountNodeProps {
[key: string]: any
}

export interface StrictMountNodeProps {
/** Additional classes. */
className?: string

Expand Down
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, StrictMountNodeProps } from './MountNode'
4 changes: 3 additions & 1 deletion src/addons/Pagination/Pagination.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@ import * as React from 'react'
import { SemanticShorthandItem } from '../..'
import { default as PaginationItem, PaginationItemProps } from './PaginationItem'

export interface PaginationProps {
export interface PaginationProps extends StrictPaginationProps {
[key: string]: any
}

export interface StrictPaginationProps {
/** A pagination item can have an aria label. */
'aria-label'?: string

Expand Down
4 changes: 3 additions & 1 deletion src/addons/Pagination/PaginationItem.d.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import * as React from 'react'

export interface PaginationItemProps {
export interface PaginationItemProps extends StrictPaginationItemProps {
[key: string]: any
}

export interface StrictPaginationItemProps {
/** A pagination item can be active. */
active?: boolean

Expand Down
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, StrictPaginationProps } from './Pagination'
4 changes: 3 additions & 1 deletion src/addons/Portal/Portal.d.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import * as React from 'react'
import { default as PortalInner } from './PortalInner'

export interface PortalProps {
export interface PortalProps extends StrictPortalProps {
[key: string]: any
}

export interface StrictPortalProps {
/** Primary content. */
children?: React.ReactNode

Expand Down
4 changes: 3 additions & 1 deletion src/addons/Portal/PortalInner.d.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import * as React from 'react'

export interface PortalInnerProps {
export interface PortalInnerProps extends StrictPortalInnerProps {
[key: string]: any
}

export interface StrictPortalInnerProps {
/** Primary content. */
children: React.ReactNode

Expand Down
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, StrictPortalProps } from './Portal'
6 changes: 4 additions & 2 deletions src/addons/Radio/Radio.d.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import * as React from 'react'
import { CheckboxProps } from '../../modules/Checkbox'
import { StrictCheckboxProps } from '../../modules/Checkbox'

export interface RadioProps extends CheckboxProps {
export interface RadioProps extends StrictRadioProps {
[key: string]: any
}

export interface StrictRadioProps extends StrictCheckboxProps {
/** Format to emphasize the current selection state. */
slider?: boolean

Expand Down
2 changes: 1 addition & 1 deletion src/addons/Radio/index.d.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export { default, RadioProps } from './Radio'
export { default, RadioProps, StrictRadioProps } from './Radio'
4 changes: 3 additions & 1 deletion src/addons/Ref/Ref.d.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import * as React from 'react'

export interface RefProps {
export interface RefProps extends StrictRefProps {
[key: string]: any
}

export interface StrictRefProps {
/** Primary content. */
children?: React.ReactNode

Expand Down
2 changes: 1 addition & 1 deletion src/addons/Ref/index.d.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export { default, RefProps } from './Ref'
export { default, RefProps, StrictRefProps } from './Ref'
4 changes: 3 additions & 1 deletion src/addons/Responsive/Responsive.d.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import * as React from 'react'

export interface ResponsiveProps {
export interface ResponsiveProps extends StrictResponsiveProps {
[key: string]: any
}

export interface StrictResponsiveProps {
/** An element type to render as (string or function). */
as?: any

Expand Down
1 change: 1 addition & 0 deletions src/addons/Responsive/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
export {
default,
ResponsiveProps,
StrictResponsiveProps,
ResponsiveOnUpdateData,
ResponsiveWidthShorthand,
} from './Responsive'
6 changes: 4 additions & 2 deletions src/addons/Select/Select.d.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
import * as React from 'react'

import { DropdownProps } from '../../modules/Dropdown'
import { StrictDropdownProps } from '../../modules/Dropdown'
import DropdownDivider from '../../modules/Dropdown/DropdownDivider'
import DropdownHeader from '../../modules/Dropdown/DropdownHeader'
import DropdownItem, { DropdownItemProps } from '../../modules/Dropdown/DropdownItem'
import DropdownMenu from '../../modules/Dropdown/DropdownMenu'

export interface SelectProps extends DropdownProps {
export interface SelectProps extends StrictSelectProps {
[key: string]: any
}

export interface StrictSelectProps extends StrictDropdownProps {
/** Array of Dropdown.Item props e.g. `{ text: '', value: '' }` */
options: DropdownItemProps[]
}
Expand Down
2 changes: 1 addition & 1 deletion src/addons/Select/index.d.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export { default, SelectProps } from './Select'
export { default, SelectProps, StrictSelectProps } from './Select'
4 changes: 3 additions & 1 deletion src/addons/TextArea/TextArea.d.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import * as React from 'react'

export interface TextAreaProps {
export interface TextAreaProps extends StrictTextAreaProps {
[key: string]: any
}

export interface StrictTextAreaProps {
/** An element type to render as (string or function). */
as?: any

Expand Down
2 changes: 1 addition & 1 deletion src/addons/TextArea/index.d.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export { default, TextAreaProps } from './TextArea'
export { default, TextAreaProps, StrictTextAreaProps } from './TextArea'
4 changes: 3 additions & 1 deletion src/addons/TransitionablePortal/TransitionablePortal.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@ import * as React from 'react'
import { TransitionEventData, TransitionProps } from '../../modules/Transition/Transition'
import { PortalProps } from '../Portal/Portal'

export interface TransitionablePortalProps {
export interface TransitionablePortalProps extends StrictTransitionablePortalProps {
[key: string]: any
}

export interface StrictTransitionablePortalProps {
/** Primary content. */
children: React.ReactNode

Expand Down
1 change: 1 addition & 0 deletions src/addons/TransitionablePortal/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
export {
default,
TransitionablePortalProps,
StrictTransitionablePortalProps,
TransitionablePortalState,
} from './TransitionablePortal'
4 changes: 3 additions & 1 deletion src/behaviors/Visibility/Visibility.d.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import * as React from 'react'

export interface VisibilityProps {
export interface VisibilityProps extends StrictVisibilityProps {
[key: string]: any
}

export interface StrictVisibilityProps {
/** An element type to render as (string or function). */
as?: any

Expand Down
1 change: 1 addition & 0 deletions src/behaviors/Visibility/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ export {
VisibilityEventData,
VisibilityOnPassed,
VisibilityProps,
StrictVisibilityProps,
} from './Visibility'
4 changes: 3 additions & 1 deletion src/collections/Breadcrumb/Breadcrumb.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@ import { IconProps } from '../../elements/Icon'
import BreadcrumbDivider from './BreadcrumbDivider'
import { default as BreadcrumbSection, BreadcrumbSectionProps } from './BreadcrumbSection'

export interface BreadcrumbProps {
export interface BreadcrumbProps extends StrictBreadcrumbProps {
[key: string]: any
}

export interface StrictBreadcrumbProps {
/** An element type to render as (string or function). */
as?: any

Expand Down
4 changes: 3 additions & 1 deletion src/collections/Breadcrumb/BreadcrumbDivider.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@ import * as React from 'react'
import { SemanticShorthandContent, SemanticShorthandItem } from '../..'
import { IconProps } from '../../elements/Icon'

export interface BreadcrumbDividerProps {
export interface BreadcrumbDividerProps extends StrictBreadcrumbDividerProps {
[key: string]: any
}

export interface StrictBreadcrumbDividerProps {
/** An element type to render as (string or function). */
as?: any

Expand Down
4 changes: 3 additions & 1 deletion src/collections/Breadcrumb/BreadcrumbSection.d.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import * as React from 'react'
import { SemanticShorthandContent } from '../..'

export interface BreadcrumbSectionProps {
export interface BreadcrumbSectionProps extends StrictBreadcrumbSectionProps {
[key: string]: any
}

export interface StrictBreadcrumbSectionProps {
/** An element type to render as (string or function). */
as?: any

Expand Down
2 changes: 1 addition & 1 deletion src/collections/Breadcrumb/index.d.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export { default, BreadcrumbProps } from './Breadcrumb'
export { default, BreadcrumbProps, StrictBreadcrumbProps } from './Breadcrumb'
4 changes: 3 additions & 1 deletion src/collections/Form/Form.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@ import FormRadio from './FormRadio'
import FormSelect from './FormSelect'
import FormTextArea from './FormTextArea'

export interface FormProps {
export interface FormProps extends StrictFormProps {
[key: string]: any
}

export interface StrictFormProps {
/** An element type to render as (string or function). */
as?: any

Expand Down
8 changes: 5 additions & 3 deletions src/collections/Form/FormButton.d.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
import * as React from 'react'

import { SemanticShorthandItem } from '../..'
import { ButtonProps } from '../../elements/Button'
import { StrictButtonProps } from '../../elements/Button'
import { LabelProps } from '../../elements/Label'
import { FormFieldProps } from './FormField'
import { StrictFormFieldProps } from './FormField'

export interface FormButtonProps extends FormFieldProps, ButtonProps {
export interface FormButtonProps extends StrictFormButtonProps {
[key: string]: any
}

export interface StrictFormButtonProps extends StrictFormFieldProps, StrictButtonProps {
/** An element type to render as (string or function). */
as?: any

Expand Down
8 changes: 5 additions & 3 deletions src/collections/Form/FormCheckbox.d.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import * as React from 'react'

import { CheckboxProps } from '../../modules/Checkbox'
import { FormFieldProps } from './FormField'
import { StrictCheckboxProps } from '../../modules/Checkbox'
import { StrictFormFieldProps } from './FormField'

export interface FormCheckboxProps extends FormFieldProps, CheckboxProps {
export interface FormCheckboxProps extends StrictFormCheckboxProps {
[key: string]: any
}

export interface StrictFormCheckboxProps extends StrictFormFieldProps, StrictCheckboxProps {
/** An element type to render as (string or function). */
as?: any

Expand Down
8 changes: 5 additions & 3 deletions src/collections/Form/FormDropdown.d.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import * as React from 'react'

import { DropdownProps } from '../../modules/Dropdown'
import { FormFieldProps } from './FormField'
import { StrictDropdownProps } from '../../modules/Dropdown'
import { StrictFormFieldProps } from './FormField'

export interface FormDropdownProps extends FormFieldProps, DropdownProps {
export interface FormDropdownProps extends StrictFormDropdownProps {
[key: string]: any
}

export interface StrictFormDropdownProps extends StrictFormFieldProps, StrictDropdownProps {
/** An element type to render as (string or function). */
as?: any

Expand Down
4 changes: 3 additions & 1 deletion src/collections/Form/FormField.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@ import {
SemanticWIDTHS,
} from '../..'

export interface FormFieldProps {
export interface FormFieldProps extends StrictFormFieldProps {
[key: string]: any
}

export interface StrictFormFieldProps {
/** An element type to render as (string or function). */
as?: any

Expand Down
4 changes: 3 additions & 1 deletion src/collections/Form/FormGroup.d.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import * as React from 'react'
import { SemanticWIDTHS } from '../..'

export interface FormGroupProps {
export interface FormGroupProps extends StrictFormGroupProps {
[key: string]: any
}

export interface StrictFormGroupProps {
/** An element type to render as (string or function). */
as?: any

Expand Down
8 changes: 5 additions & 3 deletions src/collections/Form/FormInput.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@ import * as React from 'react'

import { SemanticShorthandItem } from '../..'
import { LabelProps } from '../../elements/Label'
import { InputProps } from '../../elements/Input'
import { FormFieldProps } from './FormField'
import { StrictInputProps } from '../../elements/Input'
import { StrictFormFieldProps } from './FormField'

export interface FormInputProps extends FormFieldProps, InputProps {
export interface FormInputProps extends StrictFormInputProps {
[key: string]: any
}

export interface StrictFormInputProps extends StrictFormFieldProps, StrictInputProps {
/** An element type to render as (string or function). */
as?: any

Expand Down
8 changes: 5 additions & 3 deletions src/collections/Form/FormRadio.d.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import * as React from 'react'

import { RadioProps } from '../../addons/Radio'
import { FormFieldProps } from './FormField'
import { StrictRadioProps } from '../../addons/Radio'
import { StrictFormFieldProps } from './FormField'

export interface FormRadioProps extends FormFieldProps, RadioProps {
export interface FormRadioProps extends StrictFormRadioProps {
[key: string]: any
}

export interface StrictFormRadioProps extends StrictFormFieldProps, StrictRadioProps {
/** An element type to render as (string or function). */
as?: any

Expand Down
Loading

0 comments on commit 3e4243a

Please sign in to comment.