mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-08-27 11:40:08 +08:00
Merge pull request #7349 from vlesierse/master
Added typings for react-router-bootstrap
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
// React-Router-Bootstrap Test
|
||||
// ================================================================================
|
||||
///<reference path="../react/react.d.ts"/>
|
||||
///<reference path="../react-bootstrap/react-bootstrap.d.ts"/>
|
||||
///<reference path="react-router-bootstrap.d.ts"/>
|
||||
|
||||
// Imports
|
||||
// --------------------------------------------------------------------------------
|
||||
import * as React from 'react';
|
||||
import { Component, CSSProperties } from 'react';
|
||||
import { Button } from 'react-bootstrap';
|
||||
import { LinkContainer, IndexLinkContainer } from 'react-router-bootstrap'
|
||||
|
||||
|
||||
export class ReactRouterBootstrapTest extends Component<any, any> {
|
||||
callback() {
|
||||
alert('Callback: ' + JSON.stringify(arguments));
|
||||
}
|
||||
|
||||
public render() {
|
||||
let style: CSSProperties = { padding: '50px' };
|
||||
return (
|
||||
<div style={style}>
|
||||
|
||||
<div style={style}>
|
||||
<LinkContainer to="/page"><Button>Link</Button></LinkContainer>
|
||||
<IndexLinkContainer to="/index"><Button>Link</Button></IndexLinkContainer>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
// Type definitions for react-router-bootstrap
|
||||
// Project: https://github.com/react-bootstrap/react-router-bootstrap
|
||||
// Definitions by: Vincent Lesierse <https://github.com/vlesierse>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
///<reference path="../react/react.d.ts"/>
|
||||
///<reference path="../react-router/react-router.d.ts"/>
|
||||
|
||||
declare namespace ReactRouterBootstrap {
|
||||
// Import React
|
||||
import React = __React;
|
||||
|
||||
interface LinkContainerProps extends ReactRouter.LinkProps {
|
||||
disabled?: boolean
|
||||
}
|
||||
interface LinkContainer extends React.ComponentClass<LinkContainerProps> {}
|
||||
interface LinkContainerElement extends React.ReactElement<LinkContainerProps> {}
|
||||
const LinkContainer: LinkContainer
|
||||
|
||||
const IndexLinkContainer: LinkContainer
|
||||
}
|
||||
|
||||
declare module "react-router-bootstrap/lib/LinkContainer" {
|
||||
|
||||
export default ReactRouterBootstrap.LinkContainer
|
||||
|
||||
}
|
||||
|
||||
declare module "react-router-bootstrap/lib/IndexLinkContainer" {
|
||||
|
||||
export default ReactRouterBootstrap.IndexLinkContainer
|
||||
|
||||
}
|
||||
|
||||
declare module "react-router-bootstrap" {
|
||||
|
||||
import LinkContainer from "react-router-bootstrap/lib/LinkContainer"
|
||||
|
||||
import IndexLinkContainer from "react-router-bootstrap/lib/IndexLinkContainer"
|
||||
|
||||
export {
|
||||
LinkContainer,
|
||||
IndexLinkContainer
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user