Added Custom Tab Layout types to react-bootstrap.d.ts

This commit is contained in:
Alexey Morozov
2016-06-17 17:37:13 +03:00
parent 1315d46f80
commit ac5abd39ed
2 changed files with 60 additions and 2 deletions

View File

@@ -502,6 +502,33 @@ export class ReactBootstrapTest extends Component<any, any> {
</Tabs>
</div>
<div style={style}>
<Tab.Container id="left-tabs-example" defaultActiveKey="first">
<Row className="clearfix">
<Col sm={4}>
<Nav bsStyle="pills" stacked>
<NavItem eventKey="first">
Tab 1
</NavItem>
<NavItem eventKey="second">
Tab 2
</NavItem>
</Nav>
</Col>
<Col sm={8}>
<Tab.Content animation>
<Tab.Pane eventKey="first">
Tab 1 content
</Tab.Pane>
<Tab.Pane eventKey="second">
Tab 2 content
</Tab.Pane>
</Tab.Content>
</Col>
</Row>
</Tab.Container>
</div>
<div style={style}>
<Pager>
<PageItem href='#'>Previous</PageItem>

View File

@@ -435,8 +435,39 @@ declare module "react-bootstrap" {
animation?: boolean;
eventKey?: any; // TODO: Add more specific type
}
type Tab = React.ClassicComponent<TabProps, {}>;
var Tab: React.ClassicComponentClass<TabProps>;
interface TabClass extends React.ClassicComponentClass<TabProps> {
Container: TabContainer;
Pane: TabPane;
Content: TabClass;
}
type Tab = TabClass;
var Tab: TabClass;
// <Tab.Container />
// ----------------------------------------
interface TabContainerProps extends React.HTMLAttributes {
activeKey?: any;
defaultActiveKey?: any;
generateChildId?: (eventKey: any, type: any) => string;
}
type TabContainer = React.ClassicComponentClass<TabContainerProps>;
// <Tab.Pane />
// ----------------------------------------
interface TabPaneProps extends React.HTMLAttributes {
animation?: boolean | React.ComponentClass<any>;
'aria-labelledby'?: string;
bsClass?: string;
eventKey?: any;
onEnter?: Function;
onEntered?: Function;
onEntering?: Function;
onExit?: Function;
onExited?: Function;
onExiting?: Function;
unmountOnExit?: boolean;
}
type TabPane = React.ClassicComponentClass<TabPaneProps>;
// <Pager />
// ----------------------------------------