Skip to content

Commit

Permalink
(types) Removed links and replaces JSX.Element React.ReactElement (#1009
Browse files Browse the repository at this point in the history
)

* removed links and replaces JSX.Element

* fixed reactElement definition
  • Loading branch information
Gregjarvez authored and iRoachie committed Mar 17, 2018
1 parent 827c03f commit bf85813
Showing 1 changed file with 13 additions and 28 deletions.
41 changes: 13 additions & 28 deletions src/index.d.ts
Expand Up @@ -93,7 +93,6 @@ export interface TextProps extends TextProperties {
/**
* HTML Style Headings
*
* @see https://react-native-training.github.io/react-native-elements/API/HTML_style_headings/
*/
export class Text extends React.Component<TextProps, any> {}

Expand Down Expand Up @@ -207,7 +206,6 @@ export interface AvatarProps {
/**
* Avatar Component
*
* @see https://react-native-training.github.io/react-native-elements/API/avatar/
*/
export class Avatar extends React.Component<AvatarProps, any> {}

Expand Down Expand Up @@ -329,7 +327,6 @@ export interface ButtonProps extends TouchableWithoutFeedbackProps {
/**
* Button component
*
* @see https://react-native-training.github.io/react-native-elements/API/buttons/
*/
export class Button extends React.Component<ButtonProps, any> {}

Expand Down Expand Up @@ -359,7 +356,7 @@ export interface BadgeProps {
/**
* Override the default badge contents, mutually exclusive with 'value' property
*/
children?: JSX.Element;
children?: React.ReactElement<{}>;

/**
* Custom component to replace the badge outer component
Expand All @@ -377,7 +374,6 @@ export interface BadgeProps {
/**
* Badge component
*
* @see https://react-native-training.github.io/react-native-elements/API/badge/
*/
export class Badge extends React.Component<BadgeProps, any> {}

Expand All @@ -402,7 +398,7 @@ export interface CardProps {
/**
* Card title
*/
title?: string | JSX.Element;
title?: string | React.ReactElement<{}>;

/**
* Additional title styling (if title provided)
Expand Down Expand Up @@ -468,15 +464,14 @@ export interface CardProps {
/**
* Card component
*
* @see https://react-native-training.github.io/react-native-elements/API/card/
*/
export class Card extends React.Component<CardProps, any> {}

/**
* Set the buttons within a Group.
*/
export interface ElementObject {
element: JSX.Element | React.ReactType;
element: React.ReactElement<{}> | React.ReactType;
}

/**
Expand Down Expand Up @@ -647,7 +642,7 @@ export interface CheckBoxProps {
/**
* Title of checkbox
*/
title?: string | JSX.Element;
title?: string | React.ReactElement<{}>;

/**
* Style of main container
Expand Down Expand Up @@ -762,7 +757,7 @@ export interface InputProps extends TextInputProperties {
/**
* Displays an icon to the left (optional)
*/
leftIcon?: JSX.Element;
leftIcon?: React.ReactElement<{}>;

/**
* Styling for left Icon Component container
Expand All @@ -772,7 +767,7 @@ export interface InputProps extends TextInputProperties {
/**
* Displays an icon to the right (optional)
*/
rightIcon?: JSX.Element;
rightIcon?: React.ReactElement<{}>;

/**
* Styling for the right icon container
Expand Down Expand Up @@ -926,7 +921,7 @@ export interface HeaderIcon extends IconObject {
/**
* Defines the types that can be used in a header sub component
*/
export type HeaderSubComponent = JSX.Element | TextProps | HeaderIcon;
export type HeaderSubComponent = React.ReactElement<{}> | TextProps | HeaderIcon;

export interface HeaderProps extends ViewProperties {
/**
Expand Down Expand Up @@ -979,7 +974,6 @@ export interface HeaderProps extends ViewProperties {

/**
* Header component
* @see https://react-native-training.github.io/react-native-elements/API/header/
*/
export class Header extends React.Component<HeaderProps, any> {}

Expand Down Expand Up @@ -1062,7 +1056,6 @@ export interface IconProps {

/**
* Icon component
* @see https://react-native-training.github.io/react-native-elements/API/icons/
*/
export class Icon extends React.Component<IconProps, any> {}

Expand All @@ -1076,15 +1069,14 @@ export interface ListProps extends ViewProperties {

/**
* List component
* @see https://react-native-training.github.io/react-native-elements/API/lists/
*/
export class List extends React.Component<ListProps, any> {}

export interface ListItemProps {
/**
* Left avatar. This is the React Native Image source prop. Avatar can be used in parallel to leftIcon if needed.
*/
avatar?: string | ImageURISource | JSX.Element;
avatar?: string | ImageURISource | React.ReactElement<{}>;

/**
* Avatar styling. This is the React Native Image style prop
Expand Down Expand Up @@ -1166,7 +1158,7 @@ export interface ListItemProps {
/**
* Main title for list item, can be text or custom view
*/
title?: string | JSX.Element;
title?: string | React.ReactElement<{}>;

/**
* Number of lines for title
Expand All @@ -1188,7 +1180,7 @@ export interface ListItemProps {
/**
* Subtitle text or custom view
*/
subtitle?: string | JSX.Element;
subtitle?: string | React.ReactElement<{}>;

/**
* Number of lines for Subtitle
Expand Down Expand Up @@ -1236,15 +1228,15 @@ export interface ListItemProps {
/**
* Add a label with your own styling by providing a label={} prop to ListItem
*/
label?: JSX.Element;
label?: React.ReactElement<{}>;

/**
* Icon configuration for left icon, either a name from the icon library (like material) or a React Native element like Image.
* leftIcon can be used in parallel to avatar if needed.
* {name, color, style, type}
* (type defaults to material icons) OR React Native element
*/
leftIcon?: IconObject | JSX.Element;
leftIcon?: IconObject | React.ReactElement<{}>;

/**
* Attaches an onPress on left Icon
Expand All @@ -1268,7 +1260,7 @@ export interface ListItemProps {
* React Native element icon configuration for right icon, either a name from the icon library (like material) or a React Native element like Image.
* Shows up unless hideChevron is set
*/
rightIcon?: IconObject | JSX.Element;
rightIcon?: IconObject | React.ReactElement<{}>;

/**
* Attaches an onPress on right Icon
Expand Down Expand Up @@ -1422,7 +1414,6 @@ export interface ListItemProps {

/**
* ListItem component
* @see https://react-native-training.github.io/react-native-elements/API/lists/
*/
export class ListItem extends React.Component<ListItemProps, any> {}

Expand Down Expand Up @@ -1509,7 +1500,6 @@ export interface PricingCardProps {

/**
* PricingCard component
* @see https://react-native-training.github.io/react-native-elements/API/pricing/
*/
export class PricingCard extends React.Component<PricingCardProps, any> {}

Expand Down Expand Up @@ -1591,7 +1581,6 @@ export interface RatingProps {

/**
* Rating component
* @see https://react-native-training.github.io/react-native-elements/API/rating/
*/
export class Rating extends React.Component<RatingProps, any> {}

Expand Down Expand Up @@ -1789,7 +1778,6 @@ type SearchBarProps = SearchBarWrapperProps &

/**
* SearchBar component
* @see https://react-native-training.github.io/react-native-elements/API/searchbar/
*/
export class SearchBar extends React.Component<SearchBarProps, any> {
/**
Expand Down Expand Up @@ -1944,7 +1932,6 @@ export interface SliderProps {

/**
* Slider component
* @see https://react-native-training.github.io/react-native-elements/API/slider/
*/
export class Slider extends React.Component<SliderProps, any> {}

Expand Down Expand Up @@ -2078,7 +2065,6 @@ export interface SocialIconProps {

/**
* SocialIcon component
* @see https://react-native-training.github.io/react-native-elements/API/social_icons/
*/
export class SocialIcon extends React.Component<SocialIconProps, any> {}

Expand Down Expand Up @@ -2167,7 +2153,6 @@ export interface TileProps {

/**
* Tile component
* @see https://react-native-training.github.io/react-native-elements/API/tile/
*/
export class Tile extends React.Component<TileProps, any> {}

Expand Down

0 comments on commit bf85813

Please sign in to comment.