Merge pull request #18192 from vitosamson/react-bootstrap-individual-components

refactor react-bootstrap into individual modules
This commit is contained in:
Bowden Kelly 2017-08-22 12:07:58 -07:00 committed by GitHub
commit 85663980f0
100 changed files with 1830 additions and 1138 deletions

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,17 @@
import * as React from 'react';
import { Sizes } from 'react-bootstrap';
declare class Accordion extends React.Component<AccordionProps> { }
declare namespace Accordion { }
export = Accordion;
interface AccordionProps extends React.HTMLProps<Accordion> {
bsSize?: Sizes;
bsStyle?: string;
collapsible?: boolean;
defaultExpanded?: boolean;
eventKey?: any;
expanded?: boolean;
footer?: any; // TODO: Add more specific type
header?: any; // TODO: Add more specific type
}

14
types/react-bootstrap/lib/Alert.d.ts vendored Normal file
View File

@ -0,0 +1,14 @@
import * as React from 'react';
import { Sizes } from 'react-bootstrap';
declare class Alert extends React.Component<AlertProps> { }
declare namespace Alert { }
export = Alert
interface AlertProps extends React.HTMLProps<Alert> {
bsSize?: Sizes;
bsStyle?: string;
closeLabel?: string;
/** @deprecated since v0.29.0 */ dismissAfter?: number;
onDismiss?: Function;
}

10
types/react-bootstrap/lib/Badge.d.ts vendored Normal file
View File

@ -0,0 +1,10 @@
import * as React from 'react';
declare class Badge extends React.Component<BadgeProps> { }
declare namespace Badge { }
export = Badge
interface BadgeProps extends React.HTMLProps<Badge> {
bsClass?: string;
pullRight?: boolean;
}

View File

@ -0,0 +1,12 @@
import * as React from 'react';
import * as BreadcrumbItem from './BreadcrumbItem';
declare class Breadcrumb extends React.Component<BreadcrumbProps> {
public static Item: typeof BreadcrumbItem;
}
declare namespace Breadcrumb { }
export = Breadcrumb
interface BreadcrumbProps extends React.HTMLProps<Breadcrumb> {
bsClass?: string;
}

View File

@ -0,0 +1,12 @@
import * as React from 'react';
declare class BreadcrumbItem extends React.Component<BreadcrumbItemProps> { }
declare namespace BreadcrumbItem { }
export = BreadcrumbItem
interface BreadcrumbItemProps extends React.Props<BreadcrumbItem> {
active?: boolean;
href?: string;
title?: React.ReactNode;
target?: string;
}

16
types/react-bootstrap/lib/Button.d.ts vendored Normal file
View File

@ -0,0 +1,16 @@
import * as React from 'react';
import { Sizes } from 'react-bootstrap';
declare class Button extends React.Component<ButtonProps> { }
declare namespace Button { }
export = Button
interface ButtonProps extends React.HTMLProps<Button> {
bsClass?: string;
active?: boolean;
block?: boolean;
bsStyle?: string;
bsSize?: Sizes;
componentClass?: React.ReactType;
disabled?: boolean;
}

View File

@ -0,0 +1,14 @@
import * as React from 'react';
import { Sizes } from 'react-bootstrap';
declare class ButtonGroup extends React.Component<ButtonGroupProps> { }
declare namespace ButtonGroup { }
export = ButtonGroup
interface ButtonGroupProps extends React.HTMLProps<ButtonGroup> {
block?: boolean;
bsSize?: Sizes;
bsStyle?: string;
justified?: boolean;
vertical?: boolean;
}

View File

@ -0,0 +1,14 @@
import * as React from 'react';
import { Sizes } from 'react-bootstrap';
declare class ButtonToolbar extends React.Component<ButtonToolbarProps> { }
declare namespace ButtonToolbar { }
export = ButtonToolbar
interface ButtonToolbarProps extends React.HTMLProps<ButtonToolbar> {
block?: boolean;
bsSize?: Sizes;
bsStyle?: string;
justified?: boolean;
vertical?: boolean;
}

31
types/react-bootstrap/lib/Carousel.d.ts vendored Normal file
View File

@ -0,0 +1,31 @@
import * as React from 'react';
import { Sizes, SelectCallback } from 'react-bootstrap';
import * as CarouselItem from './CarouselItem';
import * as CarouselCaption from './CarouselCaption';
declare class Carousel extends React.Component<CarouselProps> {
public static Caption: typeof CarouselCaption;
public static Item: typeof CarouselItem;
}
declare namespace Carousel { }
export = Carousel
interface CarouselProps extends React.HTMLProps<Carousel> {
activeIndex?: number;
bsSize?: Sizes;
bsStyle?: string;
controls?: boolean;
defaultActiveIndex?: number;
direction?: string;
indicators?: boolean;
interval?: number;
nextIcon?: React.ReactNode;
onSelect?: SelectCallback;
onSlideEnd?: Function;
pauseOnHover?: boolean;
prevIcon?: React.ReactNode;
slide?: boolean;
// TODO: this is incompatible with HTMLProps.wrap, which is a string
// wrap?: boolean;
}

View File

@ -0,0 +1,9 @@
import * as React from 'react';
declare class CarouselCaption extends React.Component<CarouselCaptionProps> { }
declare namespace CarouselCaption { }
export = CarouselCaption
interface CarouselCaptionProps extends React.HTMLProps<CarouselCaption> {
componentClass?: React.ReactType;
}

View File

@ -0,0 +1,14 @@
import * as React from 'react';
declare class CarouselItem extends React.Component<CarouselItemProps> { }
declare namespace CarouselItem { }
export = CarouselItem
interface CarouselItemProps extends React.HTMLProps<CarouselItem> {
active?: boolean;
animtateIn?: boolean;
animateOut?: boolean;
direction?: string;
index?: number;
onAnimateOutEnd?: Function;
}

13
types/react-bootstrap/lib/Checkbox.d.ts vendored Normal file
View File

@ -0,0 +1,13 @@
import * as React from 'react';
declare class Checkbox extends React.Component<CheckboxProps> { }
declare namespace Checkbox { }
export = Checkbox
interface CheckboxProps extends React.HTMLProps<Checkbox> {
bsClass?: string;
disabled?: boolean;
inline?: boolean;
inputRef?: (instance: HTMLInputElement) => void;
validationState?: "success" | "warning" | "error";
}

13
types/react-bootstrap/lib/Clearfix.d.ts vendored Normal file
View File

@ -0,0 +1,13 @@
import * as React from 'react';
declare class Clearfix extends React.Component<ClearfixProps> { }
declare namespace Clearfix { }
export = Clearfix
interface ClearfixProps extends React.HTMLProps<Clearfix> {
componentClass?: React.ReactType,
visibleXsBlock?: boolean;
visibleSmBlock?: boolean;
visibleMdBlock?: boolean;
visibleLgBlock?: boolean;
}

29
types/react-bootstrap/lib/Col.d.ts vendored Normal file
View File

@ -0,0 +1,29 @@
import * as React from 'react';
declare class Col extends React.Component<ColProps> { }
declare namespace Col { }
export = Col
interface ColProps extends React.HTMLProps<Col> {
componentClass?: React.ReactType;
lg?: number;
lgHidden?: boolean;
lgOffset?: number;
lgPull?: number;
lgPush?: number;
md?: number;
mdHidden?: boolean;
mdOffset?: number;
mdPull?: number;
mdPush?: number;
sm?: number;
smHidden?: boolean;
smOffset?: number;
smPull?: number;
smPush?: number;
xs?: number;
xsHidden?: boolean;
xsOffset?: number;
xsPull?: number;
xsPush?: number;
}

15
types/react-bootstrap/lib/Collapse.d.ts vendored Normal file
View File

@ -0,0 +1,15 @@
import * as React from 'react';
import { TransitionCallbacks } from 'react-bootstrap';
declare class Collapse extends React.Component<CollapseProps> { }
declare namespace Collapse { }
export = Collapse
interface CollapseProps extends TransitionCallbacks, React.Props<Collapse> {
dimension?: 'height' | 'width' | { ( ):string };
getDimensionValue?: ( dimension:number, element:React.ReactElement<any> ) => number;
in?: boolean;
timeout?: number;
transitionAppear?: boolean;
unmountOnExit?: boolean;
}

View File

@ -0,0 +1,11 @@
import * as React from 'react';
declare class ControlLabel extends React.Component<ControlLabelProps> { }
declare namespace ControlLabel { }
export = ControlLabel
interface ControlLabelProps extends React.HTMLProps<ControlLabel> {
bsClass?: string;
htmlFor?: string;
srOnly?: boolean;
}

28
types/react-bootstrap/lib/Dropdown.d.ts vendored Normal file
View File

@ -0,0 +1,28 @@
import * as React from 'react';
import { SelectCallback } from 'react-bootstrap';
import * as DropdownToggle from './DropdownToggle';
import * as DropdownMenu from './DropdownMenu';
declare class Dropdown extends React.Component<DropdownProps> {
public static Menu: typeof DropdownMenu;
public static Toggle: typeof DropdownToggle;
}
export = Dropdown
type DropdownProps = Dropdown.DropdownBaseProps & React.HTMLProps<Dropdown>;
declare namespace Dropdown {
interface DropdownBaseProps {
bsClass?: string;
componentClass?: React.ReactType;
disabled?: boolean;
dropup?: boolean;
id: string;
onClose?: Function;
onSelect?: SelectCallback;
onToggle?: (isOpen: boolean) => void;
open?: boolean;
pullRight?: boolean;
role?: string;
}
}

View File

@ -0,0 +1,18 @@
import * as React from 'react';
import { Sizes } from 'react-bootstrap';
import { DropdownBaseProps } from './Dropdown';
declare class DropdownButton extends React.Component<DropdownButtonProps> { }
declare namespace DropdownButton { }
export = DropdownButton
interface DropdownButtonBaseProps extends DropdownBaseProps {
block?: boolean;
bsSize?: Sizes;
bsStyle?: string;
navItem?: boolean;
noCaret?: boolean;
pullRight?: boolean;
}
type DropdownButtonProps = DropdownButtonBaseProps & React.HTMLProps<DropdownButton>;

View File

@ -0,0 +1,14 @@
import * as React from 'react';
import { SelectCallback } from 'react-bootstrap';
declare class DropdownMenu extends React.Component<DropdownMenuProps> { }
declare namespace DropdownMenu { }
export = DropdownMenu
interface DropdownMenuProps extends React.HTMLProps<DropdownMenu> {
labelledBy?: string | number;
onClose?: Function;
onSelect?: SelectCallback;
open?: boolean;
pullRight?: boolean;
}

View File

@ -0,0 +1,16 @@
import * as React from 'react';
declare class DropdownToggle extends React.Component<DropdownToggle.DropdownToggleProps> { }
export = DropdownToggle
declare namespace DropdownToggle {
interface DropdownToggleProps extends React.HTMLProps<DropdownToggle> {
bsRole?: string;
noCaret?: boolean;
open?: boolean;
title?: string;
useAnchor?: boolean;
bsClass?:string; // Added since v0.30.0
bsStyle?:string;
}
}

13
types/react-bootstrap/lib/Fade.d.ts vendored Normal file
View File

@ -0,0 +1,13 @@
import * as React from 'react';
import { TransitionCallbacks } from 'react-bootstrap';
declare class Fade extends React.Component<FadeProps> { }
declare namespace Fade { }
export = Fade
interface FadeProps extends TransitionCallbacks, React.HTMLProps<Fade> {
in?: boolean;
timeout?: number;
transitionAppear?: boolean;
unmountOnExit?: boolean;
}

12
types/react-bootstrap/lib/Form.d.ts vendored Normal file
View File

@ -0,0 +1,12 @@
import * as React from 'react';
declare class Form extends React.Component<FormProps> { }
declare namespace Form { }
export = Form
interface FormProps extends React.HTMLProps<Form> {
bsClass?: string;
componentClass?: React.ReactType;
horizontal?: boolean;
inline?: boolean;
}

View File

@ -0,0 +1,20 @@
import * as React from 'react';
import { Sizes } from 'react-bootstrap';
import * as FormControlFeedback from './FormControlFeedback';
import * as FormControlStatic from './FormControlStatic';
declare class FormControl extends React.Component<FormControlProps> {
public static Feedback: typeof FormControlFeedback;
public static Static: typeof FormControlStatic;
}
declare namespace FormControl { }
export = FormControl
interface FormControlProps extends React.HTMLProps<FormControl> {
bsClass?: string;
bsSize?: Sizes;
componentClass?: React.ReactType;
id?: string;
inputRef?: (instance: HTMLInputElement) => void;
type?: string;
}

View File

@ -0,0 +1,7 @@
import * as React from 'react';
declare class FormControlFeedback extends React.Component<FormControlFeedbackProps> { }
declare namespace FormControlFeedback { }
export = FormControlFeedback
interface FormControlFeedbackProps extends React.HTMLProps<FormControlFeedback> { }

View File

@ -0,0 +1,10 @@
import * as React from 'react';
declare class FormControlStatic extends React.Component<FormControlStaticProps> { }
declare namespace FormControlStatic { }
export = FormControlStatic
interface FormControlStaticProps extends React.HTMLProps<FormControlStatic> {
bsClass?: string;
componentClass?: React.ReactType;
}

View File

@ -0,0 +1,13 @@
import * as React from 'react';
import { Sizes } from 'react-bootstrap';
declare class FormGroup extends React.Component<FormGroupProps> { }
declare namespace FormGroup { }
export = FormGroup
interface FormGroupProps extends React.HTMLProps<FormGroup> {
bsClass?: string;
bsSize?: Sizes;
controlId?: string;
validationState?: "success" | "warning" | "error";
}

View File

@ -0,0 +1,10 @@
import * as React from 'react';
declare class Glyphicon extends React.Component<GlyphiconProps> { }
declare namespace Glyphicon { }
export = Glyphicon
interface GlyphiconProps extends React.HTMLProps<Glyphicon> {
// Required
glyph: string;
}

11
types/react-bootstrap/lib/Grid.d.ts vendored Normal file
View File

@ -0,0 +1,11 @@
import * as React from 'react';
declare class Grid extends React.Component<GridProps> { }
declare namespace Grid { }
export = Grid
interface GridProps extends React.HTMLProps<Grid> {
componentClass?: React.ReactType;
fluid?: boolean;
bsClass?: string;
}

View File

@ -0,0 +1,9 @@
import * as React from 'react';
declare class HelpBlock extends React.Component<HelpBlockProps> { }
declare namespace HelpBlock { }
export = HelpBlock
interface HelpBlockProps extends React.HTMLProps<HelpBlock> {
bsClass?: string;
}

12
types/react-bootstrap/lib/Image.d.ts vendored Normal file
View File

@ -0,0 +1,12 @@
import * as React from 'react';
declare class Image extends React.Component<ImageProps> { }
declare namespace Image { }
export = Image
interface ImageProps extends React.HTMLProps<Image> {
circle?: boolean;
responsive?: boolean;
rounded?: boolean;
thumbnail?: boolean;
}

View File

@ -0,0 +1,16 @@
import * as React from 'react';
import { Sizes } from 'react-bootstrap';
import * as InputGroupAddon from './InputGroupAddon';
import * as InputGroupButton from './InputGroupButton';
declare class InputGroup extends React.Component<InputGroupProps> {
public static Addon: typeof InputGroupAddon;
public static Button: typeof InputGroupButton;
}
declare namespace InputGroup { }
export = InputGroup
interface InputGroupProps extends React.HTMLProps<InputGroup> {
bsClass?: string;
bsSize?: Sizes;
}

View File

@ -0,0 +1,7 @@
import * as React from 'react';
declare class InputGroupAddon extends React.Component<InputGroupAddonProps> { }
declare namespace InputGroupAddon { }
export = InputGroupAddon
interface InputGroupAddonProps extends React.HTMLProps<InputGroupAddon> { }

View File

@ -0,0 +1,7 @@
import * as React from 'react';
declare class InputGroupButton extends React.Component<InputGroupButtonProps> { }
declare namespace InputGroupButton { }
export = InputGroupButton
interface InputGroupButtonProps extends React.HTMLProps<InputGroupButton> { }

View File

@ -0,0 +1,9 @@
import * as React from 'react';
declare class Jumbotron extends React.Component<JumbotronProps> { }
declare namespace Jumbotron { }
export = Jumbotron
interface JumbotronProps extends React.HTMLProps<Jumbotron> {
componentClass?: React.ReactType;
}

11
types/react-bootstrap/lib/Label.d.ts vendored Normal file
View File

@ -0,0 +1,11 @@
import * as React from 'react';
import { Sizes } from 'react-bootstrap';
declare class Label extends React.Component<LabelProps> { }
declare namespace Label { }
export = Label
interface LabelProps extends React.HTMLProps<Label> {
bsSize?: Sizes;
bsStyle?: string;
}

View File

@ -0,0 +1,10 @@
import * as React from 'react';
declare class ListGroup extends React.Component<ListGroupProps> { }
declare namespace ListGroup { }
export = ListGroup
interface ListGroupProps extends React.HTMLProps<ListGroup> {
componentClass?: React.ReactType; // Added since v0.30.0
fill?: boolean; // TODO: Add more specific type
}

View File

@ -0,0 +1,15 @@
import * as React from 'react';
import { Sizes } from 'react-bootstrap';
declare class ListGroupItem extends React.Component<ListGroupItemProps> { }
declare namespace ListGroupItem { }
export = ListGroupItem
interface ListGroupItemProps extends React.HTMLProps<ListGroupItem> {
active?: any;
bsSize?: Sizes;
bsStyle?: string;
eventKey?: any;
header?: any; // TODO: Add more specific type
listItem?: boolean;
}

22
types/react-bootstrap/lib/Media.d.ts vendored Normal file
View File

@ -0,0 +1,22 @@
import * as React from 'react';
import * as MediaBody from './MediaBody';
import * as MediaHeading from './MediaHeading';
import * as MediaLeft from './MediaLeft';
import * as MediaList from './MediaList';
import * as MediaListItem from './MediaListItem';
import * as MediaRight from './MediaRight';
declare class Media extends React.Component<MediaProps> {
public static Body: typeof MediaBody;
public static Heading: typeof MediaHeading;
public static Left: typeof MediaLeft;
public static Right: typeof MediaRight;
public static List: typeof MediaList;
public static ListItem: typeof MediaListItem;
}
declare namespace Media { }
export = Media
interface MediaProps extends React.HTMLProps<Media> {
componentClass?: React.ReactType;
}

View File

@ -0,0 +1,9 @@
import * as React from 'react';
declare class MediaBody extends React.Component<MediaBodyProps> { }
declare namespace MediaBody { }
export = MediaBody
interface MediaBodyProps extends React.Props<MediaBody> {
componentClass?: React.ReactType;
}

View File

@ -0,0 +1,9 @@
import * as React from 'react';
declare class MediaHeading extends React.Component<MediaHeadingProps> { }
declare namespace MediaHeading { }
export = MediaHeading
interface MediaHeadingProps extends React.HTMLProps<MediaHeading> {
componentClass?: React.ReactType;
}

View File

@ -0,0 +1,9 @@
import * as React from 'react';
declare class MediaLeft extends React.Component<MediaLeftProps> { }
declare namespace MediaLeft { }
export = MediaLeft
interface MediaLeftProps extends React.HTMLProps<MediaLeft> {
align?: string;
}

View File

@ -0,0 +1,7 @@
import * as React from 'react';
declare class MediaList extends React.Component<MediaListProps> { }
declare namespace MediaList { }
export = MediaList
interface MediaListProps extends React.HTMLProps<MediaList> { }

View File

@ -0,0 +1,9 @@
import * as React from 'react';
declare class MediaListItem extends React.Component<MediaListItemProps> { }
declare namespace MediaListItem { }
export = MediaListItem
interface MediaListItemProps extends React.HTMLProps<MediaListItem> {
componentClass?: React.ReactType;
}

View File

@ -0,0 +1,9 @@
import * as React from 'react';
declare class MediaRight extends React.Component<MediaRightProps> { }
declare namespace MediaRight { }
export = MediaRight
interface MediaRightProps extends React.HTMLProps<MediaRight> {
align?: string;
}

19
types/react-bootstrap/lib/MenuItem.d.ts vendored Normal file
View File

@ -0,0 +1,19 @@
import * as React from 'react';
import { SelectCallback } from 'react-bootstrap';
declare class MenuItem extends React.Component<MenuItemProps> { }
declare namespace MenuItem { }
export = MenuItem
interface MenuItemProps extends React.HTMLProps<MenuItem> {
active?: boolean;
bsClass?: string;
disabled?: boolean;
divider?: boolean;
eventKey?: any;
header?: boolean;
onClick?: React.MouseEventHandler<{}>;
onSelect?: SelectCallback;
target?: string;
title?: string;
}

43
types/react-bootstrap/lib/Modal.d.ts vendored Normal file
View File

@ -0,0 +1,43 @@
import * as React from 'react';
import { Sizes, TransitionCallbacks } from 'react-bootstrap';
import * as ModalBody from './ModalBody';
import * as ModalHeader from './ModalHeader';
import * as ModalTitle from './ModalTitle';
import * as ModalDialog from './ModalDialog';
import * as ModalFooter from './ModalFooter';
declare class Modal extends React.Component<ModalProps> {
public static Body: typeof ModalBody;
public static Header: typeof ModalHeader;
public static Title: typeof ModalTitle;
public static Footer: typeof ModalFooter;
public static Dialog: typeof ModalDialog;
}
declare namespace Modal { }
export = Modal
interface ModalProps extends TransitionCallbacks, React.HTMLProps<Modal> {
// Required
onHide: Function;
// Optional
animation?: boolean;
autoFocus?: boolean;
backdrop?: boolean | string;
backdropClassName?: string;
backdropStyle?: any;
backdropTransitionTimeout?: number;
bsSize?: Sizes;
container?: any; // TODO: Add more specific type
containerClassName?: string;
dialogClassName?: string;
dialogComponent?: any; // TODO: Add more specific type
dialogTransitionTimeout?: number;
enforceFocus?: boolean;
keyboard?: boolean;
onBackdropClick?: (node: HTMLElement) => any;
onEscapeKeyUp?: (node: HTMLElement) => any;
onShow?: (node: HTMLElement) => any;
show?: boolean;
transition?: React.ReactElement<any>;
}

View File

@ -0,0 +1,10 @@
import * as React from 'react';
declare class ModalBody extends React.Component<ModalBodyProps> { }
declare namespace ModalBody { }
export = ModalBody
interface ModalBodyProps extends React.HTMLProps<ModalBody> {
// TODO: these props are not correct https://github.com/react-bootstrap/react-bootstrap/blob/v0.31.1/src/ModalBody.js
modalClassName?: string;
}

View File

@ -0,0 +1,16 @@
import * as React from 'react';
declare class ModalDialog extends React.Component<ModalDialogProps> { }
declare namespace ModalDialog { }
export = ModalDialog
interface ModalDialogProps extends React.HTMLProps<ModalDialog> {
// TODO: these props are not correct https://github.com/react-bootstrap/react-bootstrap/blob/v0.31.1/src/ModalDialog.js#L9
onHide?: Function;
onEnter?: Function;
onEntered?: Function;
onEntering?: Function;
onExit?: Function;
onExited?: Function;
onExiting?: Function;
}

View File

@ -0,0 +1,10 @@
import * as React from 'react';
declare class ModalFooter extends React.Component<ModalFooterProps> { }
declare namespace ModalFooter { }
export = ModalFooter
interface ModalFooterProps extends React.HTMLProps<ModalFooter> {
// TODO: these props are not correct https://github.com/react-bootstrap/react-bootstrap/blob/v0.31.1/src/ModalFooter.js
modalClassName?: string;
}

View File

@ -0,0 +1,12 @@
import * as React from 'react';
declare class ModalHeader extends React.Component<ModalHeaderProps> { }
declare namespace ModalHeader { }
export = ModalHeader
interface ModalHeaderProps extends React.HTMLProps<ModalHeader> {
// TODO: these props are not correct https://github.com/react-bootstrap/react-bootstrap/blob/v0.31.1/src/ModalHeader.js
closeButton?: boolean;
modalClassName?: string;
onHide?: Function;
}

View File

@ -0,0 +1,10 @@
import * as React from 'react';
declare class ModalTitle extends React.Component<ModalTitleProps> { }
declare namespace ModalTitle { }
export = ModalTitle
interface ModalTitleProps extends React.HTMLProps<ModalTitle> {
// TODO: props are not correct https://github.com/react-bootstrap/react-bootstrap/blob/v0.31.1/src/ModalTitle.js
modalClassName?: string;
}

25
types/react-bootstrap/lib/Nav.d.ts vendored Normal file
View File

@ -0,0 +1,25 @@
import * as React from 'react';
import { Sizes } from 'react-bootstrap';
declare class Nav extends React.Component<NavProps> { }
declare namespace Nav { }
export = Nav
// TODO: This one turned into a union of two different types
interface NavProps extends React.HTMLProps<Nav> {
// Optional
activeHref?: string;
activeKey?: any;
bsSize?: Sizes;
bsStyle?: string;
collapsible?: boolean;
eventKey?: any;
expanded?: boolean;
justified?: boolean;
navbar?: boolean;
pullRight?: boolean;
right?: boolean;
stacked?: boolean;
ulClassName?: string;
ulId?: string;
}

View File

@ -0,0 +1,14 @@
import * as React from 'react';
import { DropdownBaseProps } from './Dropdown';
declare class NavDropdown extends React.Component<NavDropdownProps> { }
declare namespace NavDropdown { }
export = NavDropdown
interface NavDropdownBaseProps extends DropdownBaseProps {
active?: boolean;
noCaret?: boolean;
eventKey?: any;
}
type NavDropdownProps = NavDropdownBaseProps & React.HTMLProps<NavDropdown>;

27
types/react-bootstrap/lib/NavItem.d.ts vendored Normal file
View File

@ -0,0 +1,27 @@
import * as React from 'react';
import { Sizes, SelectCallback } from 'react-bootstrap';
declare class NavItem extends React.Component<NavItemProps> { }
declare namespace NavItem { }
export = NavItem
interface NavItemProps extends React.HTMLProps<NavItem> {
active?: boolean;
brand?: any; // TODO: Add more specific type
bsSize?: Sizes;
bsStyle?: string;
componentClass?: React.ReactType;
defaultNavExpanded?: boolean;
eventKey?: any;
fixedBottom?: boolean;
fixedTop?: boolean;
fluid?: boolean;
inverse?: boolean;
linkId?: string;
navExpanded?: boolean;
onSelect?: SelectCallback;
onToggle?: Function;
staticTop?: boolean;
toggleButton?: any; // TODO: Add more specific type
toggleNavKey?: string | number;
}

57
types/react-bootstrap/lib/Navbar.d.ts vendored Normal file
View File

@ -0,0 +1,57 @@
import * as React from 'react';
import { Sizes } from 'react-bootstrap';
import * as NavbarBrand from './NavbarBrand';
import * as NavbarCollapse from './NavbarCollapse';
import * as NavbarHeader from './NavbarHeader';
import * as NavbarToggle from './NavbarToggle';
declare class Navbar extends React.Component<NavbarProps> {
public static Brand: typeof NavbarBrand;
public static Collapse: typeof NavbarCollapse;
public static Header: typeof NavbarHeader;
public static Toggle: typeof NavbarToggle;
public static Link: typeof NavbarLink;
public static Text: typeof NavbarText;
public static Form: typeof NavbarForm;
}
declare namespace Navbar { }
export = Navbar
interface NavbarProps extends React.HTMLProps<Navbar> {
brand?: any; // TODO: Add more specific type
bsSize?: Sizes;
bsStyle?: string;
collapseOnSelect?: boolean;
componentClass?: React.ReactType;
defaultNavExpanded?: boolean;
fixedBottom?: boolean;
fixedTop?: boolean;
fluid?: boolean;
inverse?: boolean;
navExpanded?: boolean;
onToggle?: Function;
staticTop?: boolean;
toggleButton?: any; // TODO: Add more specific type
toggleNavKey?: string | number;
}
/**
* the classes below aren't present in lib/
*/
interface NavbarLinkProps extends React.Props<NavbarLink> {
href: string;
onClick?: React.MouseEventHandler<HTMLAnchorElement>;
}
declare class NavbarLink extends React.Component<NavbarLinkProps> { }
interface NavbarTextProps extends React.HTMLProps<NavbarText> {
pullRight?: boolean;
}
declare class NavbarText extends React.Component<NavbarTextProps> { }
interface NavbarFormProps extends React.HTMLProps<NavbarForm> {
componentClass?: React.ReactType;
pullRight?: boolean;
}
declare class NavbarForm extends React.Component<NavbarFormProps> { }

View File

@ -0,0 +1,7 @@
import * as React from 'react';
declare class NavbarBrand extends React.Component<NavbarBrandProps> { }
declare namespace NavbarBrand { }
export = NavbarBrand
interface NavbarBrandProps extends React.HTMLProps<NavbarBrand> { }

View File

@ -0,0 +1,6 @@
import * as React from 'react';
declare class NavbarCollapse extends React.Component<NavbarCollapseProps> { }
declare namespace NavbarCollapse { }
export = NavbarCollapse
interface NavbarCollapseProps extends React.HTMLProps<NavbarCollapse> { }

View File

@ -0,0 +1,6 @@
import * as React from 'react';
declare class NavbarHeader extends React.Component<NavbarHeaderProps> { }
declare namespace NavbarHeader { }
export = NavbarHeader
interface NavbarHeaderProps extends React.HTMLProps<NavbarHeader> { }

View File

@ -0,0 +1,9 @@
import * as React from 'react';
declare class NavbarToggle extends React.Component<NavbarToggleProps> { }
declare namespace NavbarToggle { }
export = NavbarToggle
interface NavbarToggleProps extends React.Props<NavbarToggle> {
onClick?: React.MouseEventHandler<HTMLButtonElement>;
}

19
types/react-bootstrap/lib/Overlay.d.ts vendored Normal file
View File

@ -0,0 +1,19 @@
import * as React from 'react';
import { TransitionCallbacks } from 'react-bootstrap';
declare class Overlay extends React.Component<OverlayProps> { }
declare namespace Overlay { }
export = Overlay
interface OverlayProps extends TransitionCallbacks {
// Optional
animation?: any; // TODO: Add more specific type
container?: any; // TODO: Add more specific type
containerPadding?: number; // TODO: Add more specific type
onHide?: Function;
placement?: string;
rootClose?: boolean;
show?: boolean;
target?: Function | React.ReactInstance;
shouldUpdatePosition?: boolean;
}

View File

@ -0,0 +1,28 @@
import * as React from 'react';
declare class OverlayTrigger extends React.Component<OverlayTriggerProps> { }
declare namespace OverlayTrigger { }
export = OverlayTrigger
interface OverlayTriggerProps extends React.Props<OverlayTrigger> {
// Required
overlay: any; // TODO: Add more specific type
// Optional
animation?: any; // TODO: Add more specific type
container?: any; // TODO: Add more specific type
containerPadding?: number;
defaultOverlayShown?: boolean;
delay?: number;
delayHide?: number;
delayShow?: number;
onEnter?: Function;
onEntered?: Function;
onEntering?: Function;
onExit?: Function;
onExited?: Function;
onExiting?: Function;
placement?: string;
rootClose?: boolean;
trigger?: string | string[];
}

View File

@ -0,0 +1,6 @@
import * as React from 'react';
declare class PageHeader extends React.Component<PageHeaderProps> { }
declare namespace PageHeader { }
export = PageHeader
interface PageHeaderProps extends React.HTMLProps<PageHeader> { }

View File

@ -0,0 +1,3 @@
/** @deprecated since v0.30.0, should use <Pager.Item> instead of <PageItem>*/
import * as PagerItem from './PagerItem';
export = PagerItem;

13
types/react-bootstrap/lib/Pager.d.ts vendored Normal file
View File

@ -0,0 +1,13 @@
import * as React from 'react';
import { SelectCallback } from 'react-bootstrap';
import * as PagerItem from './PagerItem';
declare class Pager extends React.Component<PagerProps> {
public static Item: typeof PagerItem;
}
declare namespace Pager { }
export = Pager
interface PagerProps extends React.HTMLProps<Pager> {
onSelect?: SelectCallback;
}

View File

@ -0,0 +1,15 @@
import * as React from 'react';
import { SelectCallback } from 'react-bootstrap';
declare class PagerItem extends React.Component<PagerItemProps> { }
declare namespace PagerItem { }
export = PagerItem
interface PagerItemProps extends React.HTMLProps<PagerItem> {
disabled?: boolean;
eventKey?: any;
next?: boolean;
onSelect?: SelectCallback;
previous?: boolean;
target?: string;
}

View File

@ -0,0 +1,22 @@
import * as React from 'react';
import { Sizes, SelectCallback } from 'react-bootstrap';
declare class Pagination extends React.Component<PaginationProps> { }
declare namespace Pagination { }
export = Pagination
interface PaginationProps extends React.HTMLProps<Pagination> {
activePage?: number;
bsSize?: Sizes;
bsStyle?: string;
boundaryLinks?: boolean;
buttonComponentClass?: React.ReactType;
ellipsis?: React.ReactNode;
first?: React.ReactNode;
items?: number;
last?: React.ReactNode;
maxButtons?: number;
next?: React.ReactNode;
onSelect?: SelectCallback;
prev?: React.ReactNode;
}

View File

@ -0,0 +1,16 @@
import * as React from 'react';
import { SelectCallback } from 'react-bootstrap';
declare class PaginationButton extends React.Component<PaginationButtonProps> { }
declare namespace PaginationButton { }
export = PaginationButton
interface PaginationButtonProps extends React.HTMLProps<PaginationButton> {
componentClass?: React.ReactType;
className?: string;
eventKey?: any;
onSelect?: SelectCallback;
disabled?: boolean;
active?: boolean;
onClick: React.MouseEventHandler<{}>;
}

19
types/react-bootstrap/lib/Panel.d.ts vendored Normal file
View File

@ -0,0 +1,19 @@
import * as React from 'react';
import { TransitionCallbacks, Sizes, SelectCallback } from 'react-bootstrap';
declare class Panel extends React.Component<PanelProps> { }
declare namespace Panel { }
export = Panel
interface PanelProps extends TransitionCallbacks, React.HTMLProps<Panel> {
bsClass?: string;
bsSize?: Sizes;
bsStyle?: string;
collapsible?: boolean;
defaultExpanded?: boolean;
eventKey?: any;
expanded?: boolean;
footer?: React.ReactNode;
header?: React.ReactNode;
onSelect?: SelectCallback;
}

View File

@ -0,0 +1,15 @@
import * as React from 'react';
import { Sizes, SelectCallback } from 'react-bootstrap';
declare class PanelGroup extends React.Component<PanelGroupProps> { }
declare namespace PanelGroup { }
export = PanelGroup
interface PanelGroupProps extends React.HTMLProps<PanelGroup> {
accordion?: boolean;
activeKey?: any;
bsSize?: Sizes;
bsStyle?: string;
defaultActiveKey?: any;
onSelect?: SelectCallback;
}

17
types/react-bootstrap/lib/Popover.d.ts vendored Normal file
View File

@ -0,0 +1,17 @@
import * as React from 'react';
import { Sizes } from 'react-bootstrap';
declare class Popover extends React.Component<PopoverProps> { }
declare namespace Popover { }
export = Popover
interface PopoverProps extends React.HTMLProps<Popover> {
// Optional
arrowOffsetLeft?: number | string;
arrowOffsetTop?: number | string;
bsSize?: Sizes;
bsStyle?: string;
placement?: string;
positionLeft?: number | string; // String support added since v0.30.0
positionTop?: number | string; // String support added since v0.30.0
}

View File

@ -0,0 +1,19 @@
import * as React from 'react';
import { Sizes } from 'react-bootstrap';
declare class ProgressBar extends React.Component<ProgressBarProps> { }
declare namespace ProgressBar { }
export = ProgressBar
interface ProgressBarProps extends React.HTMLProps<ProgressBar> {
// Optional
active?: boolean;
bsSize?: Sizes;
bsStyle?: string;
interpolatedClass?: any; // TODO: Add more specific type
max?: number;
min?: number;
now?: number;
srOnly?: boolean;
striped?: boolean;
}

13
types/react-bootstrap/lib/Radio.d.ts vendored Normal file
View File

@ -0,0 +1,13 @@
import * as React from 'react';
declare class Radio extends React.Component<RadioProps> { }
declare namespace Radio { }
export = Radio
interface RadioProps extends React.HTMLProps<Radio> {
bsClass?: string;
disabled?: boolean;
inline?: boolean;
inputRef?: (instance: HTMLInputElement) => void;
validationState?: "success" | "warning" | "error";
}

View File

@ -0,0 +1,11 @@
import * as React from 'react';
declare class ResponsiveEmbed extends React.Component<ResponsiveEmbedProps> { }
declare namespace ResponsiveEmbed { }
export = ResponsiveEmbed
interface ResponsiveEmbedProps extends React.HTMLProps<ResponsiveEmbed> {
a16by9?: boolean;
a4by3?: boolean;
bsClass?: string;
}

9
types/react-bootstrap/lib/Row.d.ts vendored Normal file
View File

@ -0,0 +1,9 @@
import * as React from 'react';
declare class Row extends React.Component<RowProps> { }
declare namespace Row { }
export = Row
interface RowProps extends React.HTMLProps<Row> {
componentClass?: React.ReactType;
}

View File

@ -0,0 +1,13 @@
import * as React from 'react';
declare class SafeAnchor extends React.Component<SafeAnchorProps> { }
declare namespace SafeAnchor { }
export = SafeAnchor
interface SafeAnchorProps extends React.HTMLProps<SafeAnchor> {
href?: string;
onClick?: React.MouseEventHandler<{}>;
disabled?: boolean;
role?: string;
componentClass?: React.ReactType;
}

View File

@ -0,0 +1,14 @@
import * as React from 'react';
import { Sizes } from 'react-bootstrap';
declare class SplitButton extends React.Component<SplitButtonProps> { }
declare namespace SplitButton { }
export = SplitButton
interface SplitButtonProps extends React.HTMLProps<SplitButton> {
bsStyle?: string;
bsSize?: Sizes;
dropdownTitle?: any; // TODO: Add more specific type
dropup?: boolean;
pullRight?: boolean;
}

View File

@ -0,0 +1,7 @@
import * as React from 'react';
import { DropdownToggleProps } from './DropdownToggle';
declare class SplitToggle extends React.Component<SplitToggleProps> { }
declare namespace SplitToggle { }
export = SplitToggle
interface SplitToggleProps extends DropdownToggleProps, React.HTMLProps<SplitToggle> { }

22
types/react-bootstrap/lib/Tab.d.ts vendored Normal file
View File

@ -0,0 +1,22 @@
import * as React from 'react';
import { TransitionCallbacks } from 'react-bootstrap';
import * as TabContainer from './TabContainer';
import * as TabPane from './TabPane';
import * as TabContent from './TabContent';
declare class Tab extends React.Component<TabProps> {
public static Container: typeof TabContainer;
public static Content: typeof TabContent;
public static Pane: typeof TabPane;
}
declare namespace Tab { }
export = Tab
interface TabProps extends TransitionCallbacks, React.HTMLProps<Tab> {
animation?: boolean;
'aria-labelledby'?: string;
bsClass?: string;
eventKey?: any; // TODO: Add more specific type
unmountOnExit?: boolean;
tabClassName?: string;
}

View File

@ -0,0 +1,11 @@
import * as React from 'react';
declare class TabContainer extends React.Component<TabContainerProps> { }
declare namespace TabContainer { }
export = TabContainer
interface TabContainerProps extends React.HTMLAttributes<TabContainer> {
activeKey?: any;
defaultActiveKey?: any;
generateChildId?: (eventKey: any, type: any) => string;
}

View File

@ -0,0 +1,12 @@
import * as React from 'react';
declare class TabContent extends React.Component<TabContentProps> { }
declare namespace TabContent { }
export = TabContent
interface TabContentProps extends React.HTMLProps<TabContent> {
componentClass?: React.ReactType,
animation?: boolean | React.ReactType;
mountOnEnter?: boolean;
unmountOnExit?: boolean;
}

14
types/react-bootstrap/lib/TabPane.d.ts vendored Normal file
View File

@ -0,0 +1,14 @@
import * as React from 'react';
import { TransitionCallbacks } from 'react-bootstrap';
declare class TabPane extends React.Component<TabPaneProps> { }
declare namespace TabPane { }
export = TabPane
interface TabPaneProps extends TransitionCallbacks, React.HTMLProps<TabPane> {
animation?: boolean | React.ComponentClass<any>;
'aria-labelledby'?: string;
bsClass?: string;
eventKey?: any;
unmountOnExit?: boolean;
}

15
types/react-bootstrap/lib/Table.d.ts vendored Normal file
View File

@ -0,0 +1,15 @@
import * as React from 'react';
declare class Table extends React.Component<TableProps> { }
declare namespace Table { }
export = Table
interface TableProps extends React.HTMLProps<Table> {
bordered?: boolean;
condensed?: boolean;
hover?: boolean;
responsive?: boolean;
striped?: boolean;
fill?: boolean;
bsClass?: string;
}

19
types/react-bootstrap/lib/Tabs.d.ts vendored Normal file
View File

@ -0,0 +1,19 @@
import * as React from 'react';
import { SelectCallback } from 'react-bootstrap';
declare class Tabs extends React.Component<TabsProps> { }
declare namespace Tabs { }
export = Tabs
interface TabsProps extends React.HTMLProps<Tabs> {
activeKey?: any;
animation?: boolean;
bsStyle?: string;
defaultActiveKey?: any;
onSelect?: SelectCallback;
paneWidth?: any; // TODO: Add more specific type
position?: string;
tabWidth?: any; // TODO: Add more specific type
unmountOnExit?: boolean;
justified?: boolean;
}

View File

@ -0,0 +1,11 @@
import * as React from 'react';
import { Sizes } from 'react-bootstrap';
declare class Thumbnail extends React.Component<ThumbnailProps> { }
declare namespace Thumbnail { }
export = Thumbnail
interface ThumbnailProps extends React.HTMLProps<Thumbnail> {
bsSize?: Sizes;
bsStyle?: string;
}

17
types/react-bootstrap/lib/Tooltip.d.ts vendored Normal file
View File

@ -0,0 +1,17 @@
import * as React from 'react';
import { Sizes } from 'react-bootstrap';
declare class Tooltip extends React.Component<TooltipProps> { }
declare namespace Tooltip { }
export = Tooltip
interface TooltipProps extends React.HTMLProps<Tooltip> {
// Optional
arrowOffsetLeft?: number | string;
arrowOffsetTop?: number | string;
bsSize?: Sizes;
bsStyle?: string;
placement?: string;
positionLeft?: number;
positionTop?: number;
}

11
types/react-bootstrap/lib/Well.d.ts vendored Normal file
View File

@ -0,0 +1,11 @@
import * as React from 'react';
import { Sizes } from 'react-bootstrap';
declare class Well extends React.Component<WellProps> { }
declare namespace Well { }
export = Well
interface WellProps extends React.HTMLProps<Well> {
bsSize?: Sizes;
bsStyle?: string;
}

178
types/react-bootstrap/lib/index.d.ts vendored Normal file
View File

@ -0,0 +1,178 @@
import * as Accordion from './Accordion';
import * as Alert from './Alert';
import * as Badge from './Badge';
import * as Breadcrumb from './Breadcrumb';
import * as BreadcrumbItem from './BreadcrumbItem';
import * as Button from './Button';
import * as ButtonGroup from './ButtonGroup';
import * as ButtonToolbar from './ButtonToolbar';
import * as Carousel from './Carousel';
import * as CarouselCaption from './CarouselCaption';
import * as CarouselItem from './CarouselItem';
import * as Checkbox from './Checkbox';
import * as Clearfix from './Clearfix';
import * as Col from './Col';
import * as Collapse from './Collapse';
import * as ControlLabel from './ControlLabel';
import * as Dropdown from './Dropdown';
import * as DropdownButton from './DropdownButton';
import * as DropdownMenu from './DropdownMenu';
import * as DropdownToggle from './DropdownToggle';
import * as Fade from './Fade';
import * as Form from './Form';
import * as FormControl from './FormControl';
import * as FormControlFeedback from './FormControlFeedback';
import * as FormControlStatic from './FormControlStatic';
import * as FormGroup from './FormGroup';
import * as Glyphicon from './Glyphicon';
import * as Grid from './Grid';
import * as HelpBlock from './HelpBlock';
import * as Image from './Image';
import * as InputGroup from './InputGroup';
import * as InputGroupAddon from './InputGroupAddon';
import * as InputGroupButton from './InputGroupButton';
import * as Jumbotron from './Jumbotron';
import * as Label from './Label';
import * as ListGroup from './ListGroup';
import * as ListGroupItem from './ListGroupItem';
import * as Media from './Media';
import * as MediaBody from './MediaBody';
import * as MediaHeading from './MediaHeading';
import * as MediaLeft from './MediaLeft';
import * as MediaList from './MediaList';
import * as MediaListItem from './MediaListItem';
import * as MediaRight from './MediaRight';
import * as MenuItem from './MenuItem';
import * as Modal from './Modal';
import * as ModalBody from './ModalBody';
import * as ModalDialog from './ModalDialog';
import * as ModalFooter from './ModalFooter';
import * as ModalHeader from './ModalHeader';
import * as ModalTitle from './ModalTitle';
import * as Nav from './Nav';
import * as Navbar from './Navbar';
import * as NavbarBrand from './NavbarBrand';
import * as NavbarCollapse from './NavbarCollapse';
import * as NavbarHeader from './NavbarHeader';
import * as NavbarToggle from './NavbarToggle';
import * as NavDropdown from './NavDropdown';
import * as NavItem from './NavItem';
import * as Overlay from './Overlay';
import * as OverlayTrigger from './OverlayTrigger';
import * as PageHeader from './PageHeader';
import * as PageItem from './PageItem';
import * as Pager from './Pager';
import * as PagerItem from './PagerItem';
import * as Pagination from './Pagination';
import * as PaginationButton from './PaginationButton';
import * as Panel from './Panel';
import * as PanelGroup from './PanelGroup';
import * as Popover from './Popover';
import * as ProgressBar from './ProgressBar';
import * as Radio from './Radio';
import * as ResponsiveEmbed from './ResponsiveEmbed';
import * as Row from './Row';
import * as SafeAnchor from './SafeAnchor';
import * as SplitButton from './SplitButton';
import * as SplitToggle from './SplitToggle';
import * as Tab from './Tab';
import * as TabContainer from './TabContainer';
import * as TabContent from './TabContent';
import * as Table from './Table';
import * as TabPane from './TabPane';
import * as Tabs from './Tabs';
import * as Thumbnail from './Thumbnail';
import * as Tooltip from './Tooltip';
import * as Well from './Well';
import * as utils from './utils';
export {
Accordion,
Alert,
Badge,
Breadcrumb,
BreadcrumbItem,
Button,
ButtonGroup,
ButtonToolbar,
Carousel,
CarouselCaption,
CarouselItem,
Checkbox,
Clearfix,
Col,
Collapse,
ControlLabel,
Dropdown,
DropdownButton,
DropdownMenu,
DropdownToggle,
Fade,
Form,
FormControl,
FormControlFeedback,
FormControlStatic,
FormGroup,
Glyphicon,
Grid,
HelpBlock,
Image,
InputGroup,
InputGroupAddon,
InputGroupButton,
Jumbotron,
Label,
ListGroup,
ListGroupItem,
Media,
MediaBody,
MediaHeading,
MediaLeft,
MediaList,
MediaListItem,
MediaRight,
MenuItem,
Modal,
ModalBody,
ModalDialog,
ModalFooter,
ModalHeader,
ModalTitle,
Nav,
Navbar,
NavbarBrand,
NavbarCollapse,
NavbarHeader,
NavbarToggle,
NavDropdown,
NavItem,
Overlay,
OverlayTrigger,
PageHeader,
PageItem,
Pager,
PagerItem,
Pagination,
PaginationButton,
Panel,
PanelGroup,
Popover,
ProgressBar,
Radio,
ResponsiveEmbed,
Row,
SafeAnchor,
SplitButton,
SplitToggle,
Tab,
TabContainer,
TabContent,
Table,
TabPane,
Tabs,
Thumbnail,
Tooltip,
Well,
utils,
}

View File

@ -0,0 +1,2 @@
export function requiredRoles(...roles: any[]): any;
export function exclusiveRoles(...roles: any[]): any;

View File

@ -0,0 +1,32 @@
export const Size: {
LARGE: string;
SMALL: string;
XSMALL: string;
};
export const SIZE_MAP: {
large: string;
medium: string;
small: string;
xsmall: string;
lg: string;
md: string;
sm: string;
xs: string;
};
export const DEVICE_SIZES: string[];
export const State: {
SUCCESS: string;
WARNING: string;
DANGER: string;
INFO: string;
};
export const Style: {
DEFAULT: string;
PRIMARY: string;
LINK: string;
INVERSE: string;
};

View File

@ -0,0 +1,18 @@
interface BSProps {
bsClass: any;
bsSize: any;
bsStyle: any;
bsRole: any;
}
export function prefix(props: { bsClass?: any }, variant?: string): string;
export function bsClass(defaultClass: any, Component: any): any;
export function bsStyles(styles: any, defaultStyle: any, Component: any): any;
export function bsSizes(sizes: any, defaultSize: any, Component: any): any;
export function getClassSet(props: any): any;
export function getBsProps(props: any): BSProps;
export function isBsProp(propName: string): boolean;
export function splitBsProps(props: any): [BSProps, any];
export function splitBsPropsAndOmit(props: any, omittedPropNames: any): [BSProps, any];
export function addStyle(Component: any, ...styleVariant: any[]): any;
// TODO: export function _curry

View File

@ -0,0 +1 @@
export default function capitalize(string: string): string;

View File

@ -0,0 +1 @@
export default function createChainedFunction(...funcs: Function[]): Function;

View File

@ -0,0 +1,3 @@
export default function deprecationWarning(oldname: any, newname: string, link?: string): void;
export function wrapper(Component: any, ...args: any[]): any;
export function _resetWarned(): void;

View File

@ -0,0 +1,4 @@
import * as bootstrapUtils from './bootstrapUtils';
import createChainedFunction from './createChainedFunction';
export { createChainedFunction, bootstrapUtils }

View File

@ -0,0 +1 @@
export default function splitComponentProps(props: any, Component: any): [any, any];

View File

@ -0,0 +1,193 @@
import * as React from 'react';
import * as Accordion from 'react-bootstrap/lib/Accordion';
import * as Alert from 'react-bootstrap/lib/Alert';
import * as Badge from 'react-bootstrap/lib/Badge';
import * as Breadcrumb from 'react-bootstrap/lib/Breadcrumb';
import * as BreadcrumbItem from 'react-bootstrap/lib/BreadcrumbItem';
import * as Button from 'react-bootstrap/lib/Button';
import * as ButtonGroup from 'react-bootstrap/lib/ButtonGroup';
import * as ButtonToolbar from 'react-bootstrap/lib/ButtonToolbar';
import * as Carousel from 'react-bootstrap/lib/Carousel';
import * as CarouselCaption from 'react-bootstrap/lib/CarouselCaption';
import * as CarouselItem from 'react-bootstrap/lib/CarouselItem';
import * as Checkbox from 'react-bootstrap/lib/Checkbox';
import * as Clearfix from 'react-bootstrap/lib/Clearfix';
import * as Col from 'react-bootstrap/lib/Col';
import * as Collapse from 'react-bootstrap/lib/Collapse';
import * as ControlLabel from 'react-bootstrap/lib/ControlLabel';
import * as Dropdown from 'react-bootstrap/lib/Dropdown';
import * as DropdownButton from 'react-bootstrap/lib/DropdownButton';
import * as DropdownMenu from 'react-bootstrap/lib/DropdownMenu';
import * as DropdownToggle from 'react-bootstrap/lib/DropdownToggle';
import * as Fade from 'react-bootstrap/lib/Fade';
import * as Form from 'react-bootstrap/lib/Form';
import * as FormControl from 'react-bootstrap/lib/FormControl';
import * as FormControlFeedback from 'react-bootstrap/lib/FormControlFeedback';
import * as FormControlStatic from 'react-bootstrap/lib/FormControlStatic';
import * as FormGroup from 'react-bootstrap/lib/FormGroup';
import * as Glyphicon from 'react-bootstrap/lib/Glyphicon';
import * as Grid from 'react-bootstrap/lib/Grid';
import * as HelpBlock from 'react-bootstrap/lib/HelpBlock';
import * as Image from 'react-bootstrap/lib/Image';
import * as InputGroup from 'react-bootstrap/lib/InputGroup';
import * as InputGroupAddon from 'react-bootstrap/lib/InputGroupAddon';
import * as InputGroupButton from 'react-bootstrap/lib/InputGroupButton';
import * as Jumbotron from 'react-bootstrap/lib/Jumbotron';
import * as Label from 'react-bootstrap/lib/Label';
import * as ListGroup from 'react-bootstrap/lib/ListGroup';
import * as ListGroupItem from 'react-bootstrap/lib/ListGroupItem';
import * as Media from 'react-bootstrap/lib/Media';
import * as MediaBody from 'react-bootstrap/lib/MediaBody';
import * as MediaHeading from 'react-bootstrap/lib/MediaHeading';
import * as MediaLeft from 'react-bootstrap/lib/MediaLeft';
import * as MediaList from 'react-bootstrap/lib/MediaList';
import * as MediaListItem from 'react-bootstrap/lib/MediaListItem';
import * as MediaRight from 'react-bootstrap/lib/MediaRight';
import * as MenuItem from 'react-bootstrap/lib/MenuItem';
import * as Modal from 'react-bootstrap/lib/Modal';
import * as ModalBody from 'react-bootstrap/lib/ModalBody';
import * as ModalDialog from 'react-bootstrap/lib/ModalDialog';
import * as ModalFooter from 'react-bootstrap/lib/ModalFooter';
import * as ModalHeader from 'react-bootstrap/lib/ModalHeader';
import * as ModalTitle from 'react-bootstrap/lib/ModalTitle';
import * as Nav from 'react-bootstrap/lib/Nav';
import * as NavDropdown from 'react-bootstrap/lib/NavDropdown';
import * as NavItem from 'react-bootstrap/lib/NavItem';
import * as Navbar from 'react-bootstrap/lib/Navbar';
import * as NavbarBrand from 'react-bootstrap/lib/NavbarBrand';
import * as NavbarCollapse from 'react-bootstrap/lib/NavbarCollapse';
import * as NavbarHeader from 'react-bootstrap/lib/NavbarHeader';
import * as NavbarToggle from 'react-bootstrap/lib/NavbarToggle';
import * as Overlay from 'react-bootstrap/lib/Overlay';
import * as OverlayTrigger from 'react-bootstrap/lib/OverlayTrigger';
import * as PageHeader from 'react-bootstrap/lib/PageHeader';
import * as PageItem from 'react-bootstrap/lib/PageItem';
import * as Pager from 'react-bootstrap/lib/Pager';
import * as PagerItem from 'react-bootstrap/lib/PagerItem';
import * as Pagination from 'react-bootstrap/lib/Pagination';
import * as PaginationButton from 'react-bootstrap/lib/PaginationButton';
import * as Panel from 'react-bootstrap/lib/Panel';
import * as PanelGroup from 'react-bootstrap/lib/PanelGroup';
import * as Popover from 'react-bootstrap/lib/Popover';
import * as ProgressBar from 'react-bootstrap/lib/ProgressBar';
import * as Radio from 'react-bootstrap/lib/Radio';
import * as ResponsiveEmbed from 'react-bootstrap/lib/ResponsiveEmbed';
import * as Row from 'react-bootstrap/lib/Row';
import * as SafeAnchor from 'react-bootstrap/lib/SafeAnchor';
import * as SplitButton from 'react-bootstrap/lib/SplitButton';
import * as SplitToggle from 'react-bootstrap/lib/SplitToggle';
import * as Tab from 'react-bootstrap/lib/Tab';
import * as TabContainer from 'react-bootstrap/lib/TabContainer';
import * as TabContent from 'react-bootstrap/lib/TabContent';
import * as TabPane from 'react-bootstrap/lib/TabPane';
import * as Table from 'react-bootstrap/lib/Table';
import * as Tabs from 'react-bootstrap/lib/Tabs';
import * as Thumbnail from 'react-bootstrap/lib/Thumbnail';
import * as Tooltip from 'react-bootstrap/lib/Tooltip';
import * as Well from 'react-bootstrap/lib/Well';
const noop = () => {};
/**
* Mostly just checking here that TS recognizes all of the imports as Components,
* which means we properly exported them from lib
*/
export class ReactBootstrapIndividualComponentsTest extends React.Component {
render() {
return (
<div>
<Accordion />
<Alert />
<Badge />
<Breadcrumb>
<BreadcrumbItem />
</Breadcrumb>
<Button />
<ButtonGroup><Button /></ButtonGroup>
<ButtonToolbar><Button /></ButtonToolbar>
<Carousel>
<CarouselCaption />
<Carousel.Caption />
<CarouselItem />
<Carousel.Item />
</Carousel>
<Checkbox />
<Clearfix />
<Col />
<Collapse />
<ControlLabel />
<Dropdown id="foo" />
<DropdownButton id="foo" />
<DropdownMenu />
<DropdownToggle />
<Fade />
<Form />
<FormControl />
<FormControlFeedback />
<FormControlStatic />
<FormGroup />
<Glyphicon glyph="foo" />
<Grid />
<HelpBlock />
<Image />
<InputGroup />
<InputGroupAddon />
<InputGroupButton />
<Jumbotron />
<Label />
<ListGroup />
<ListGroupItem />
<Media />
<MediaBody />
<MediaHeading />
<MediaLeft />
<MediaList />
<MediaListItem />
<MediaRight />
<MenuItem />
<Modal onHide={noop} />
<ModalBody />
<ModalDialog />
<ModalFooter />
<ModalHeader />
<ModalTitle />
<Nav />
<NavDropdown id="foo" />
<NavItem />
<Navbar />
<NavbarBrand />
<NavbarCollapse />
<NavbarHeader />
<NavbarToggle />
<Overlay />
<OverlayTrigger overlay="" />
<PageHeader />
<PageItem />
<Pager />
<PagerItem />
<Pagination />
<PaginationButton onClick={noop} />
<Panel />
<PanelGroup />
<Popover />
<ProgressBar />
<Radio />
<ResponsiveEmbed />
<Row />
<SafeAnchor />
<SplitButton />
<SplitToggle />
<Tab />
<TabContainer />
<TabContent />
<TabPane />
<Table />
<Tabs />
<Thumbnail />
<Tooltip />
<Well />
</div>
);
}
}

View File

@ -15,13 +15,12 @@ import {
Radio, Checkbox, Media, InputGroup
} from 'react-bootstrap';
export class ReactBootstrapTest extends Component {
callback() {
alert('Callback: ' + JSON.stringify(arguments));
}
public render() {
render() {
let style: CSSProperties = { padding: '50px' };
let tooltip = (<Tooltip><strong>Holy guacamole!</strong> Check this info.</Tooltip>);
@ -37,6 +36,12 @@ export class ReactBootstrapTest extends Component {
return (
<div style={style}>
{ innerGlyphicon }
{ innerButton }
{ innerDropdown }
{ innerRadio }
{ innerCheckbox }
<div style={style}>
<ButtonToolbar>
<Button>Default</Button>
@ -82,7 +87,6 @@ export class ReactBootstrapTest extends Component {
</ButtonToolbar>
</div>
<div style={style}>
<ButtonToolbar>
<Button href='#'>Link</Button>
@ -90,7 +94,6 @@ export class ReactBootstrapTest extends Component {
</ButtonToolbar>
</div>
<div style={style}>
<ButtonGroup>
<Button>Left</Button>
@ -300,15 +303,12 @@ export class ReactBootstrapTest extends Component {
<div style={style}>
<Accordion>
<Panel header='Collapsible Group Item #1' eventKey='1'>
Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer
farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS.
</Panel>
<Panel header='Collapsible Group Item #2' eventKey='2'>
Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer
farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS.
</Panel>
<Panel header='Collapsible Group Item #3' eventKey='3'>
Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer
farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS.
</Panel>
</Accordion>
@ -316,7 +316,15 @@ export class ReactBootstrapTest extends Component {
<div style={style}>
<div className='static-modal'>
<Modal.Dialog onHide={this.callback} onEnter={this.callback} onEntered={this.callback} onEntering={this.callback} onExit={this.callback} onExited={this.callback} onExiting={this.callback}>
<Modal.Dialog
onHide={this.callback}
onEnter={this.callback}
onEntered={this.callback}
onEntering={this.callback}
onExit={this.callback}
onExited={this.callback}
onExiting={this.callback}
>
<Modal.Header>
<Modal.Title>Modal title</Modal.Title>
</Modal.Header>
@ -351,15 +359,6 @@ export class ReactBootstrapTest extends Component {
<hr />
<h4>Overflowing text to show scroll behavior</h4>
<p>Cras mattis consectetur purus sit amet fermentum. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Morbi leo risus, porta ac consectetur ac, vestibulum at eros.</p>
<p>Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor.</p>
<p>Aenean lacinia bibendum nulla sed consectetur. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Donec sed odio dui. Donec ullamcorper nulla non metus auctor fringilla.</p>
<p>Cras mattis consectetur purus sit amet fermentum. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Morbi leo risus, porta ac consectetur ac, vestibulum at eros.</p>
<p>Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor.</p>
<p>Aenean lacinia bibendum nulla sed consectetur. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Donec sed odio dui. Donec ullamcorper nulla non metus auctor fringilla.</p>
<p>Cras mattis consectetur purus sit amet fermentum. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Morbi leo risus, porta ac consectetur ac, vestibulum at eros.</p>
<p>Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor.</p>
<p>Aenean lacinia bibendum nulla sed consectetur. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Donec sed odio dui. Donec ullamcorper nulla non metus auctor fringilla.</p>
</Modal.Body>
<Modal.Footer>
<Button onClick={() => ({})}>Close</Button>
@ -605,7 +604,7 @@ export class ReactBootstrapTest extends Component {
onEntering={() => {}}
onExit={() => {}}
onExited={() => {}}
onExiting={()=>{}}
onExiting={() => {}}
unmountOnExit={true}
bsClass="some style" tabClassName="classname" eventKey={1} title='Tab 1'>Tab 1 content</Tab>
<Tab eventKey={2} title='Tab 2'>Tab 2 content</Tab>
@ -686,7 +685,7 @@ export class ReactBootstrapTest extends Component {
<div style={style}>
<Pagination
buttonComponentClass={( props:any ) =>
buttonComponentClass={( props: any ) =>
<SafeAnchor href="/test" disabled role="role"/>
}
maxButtons={10}/>
@ -1266,7 +1265,7 @@ export class ReactBootstrapTest extends Component {
</Media.Left>
<Media.Body>
<Media.Heading>Top aligned media</Media.Heading>
<p>Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis. Fusce condimentum nunc ac nisi vulputate fringilla. Donec lacinia congue felis in faucibus.</p>
<p>Cras purus odio, vestibulum in vulputate at, tempus viverra turpis. Fusce condimentum nunc ac nisi vulputate fringilla. Donec lacinia congue felis in faucibus.</p>
<p>Donec sed odio dui. Nullam quis risus eget urna mollis ornare vel eu leo. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.</p>
</Media.Body>
</Media>

View File

@ -15,10 +15,17 @@
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
"forceConsistentCasingInFileNames": true,
"noUnusedLocals": false
},
"files": [
"index.d.ts",
"react-bootstrap-tests.tsx"
"lib/utils/capitalize.d.ts",
"test/react-bootstrap-tests.tsx",
"test/react-bootstrap-individual-components-tests.tsx",
"lib/utils/deprecationWarning.d.ts",
"lib/utils/PropTypes.d.ts",
"lib/utils/splitComponentProps.d.ts",
"lib/utils/StyleConfig.d.ts"
]
}
}

View File

@ -0,0 +1,3 @@
{
"extends": "dtslint/dt.json"
}