From 32cd7f2a9349e7eb1ae01f916687b9dd23c08094 Mon Sep 17 00:00:00 2001 From: Vincent Lesierse Date: Fri, 25 Dec 2015 09:03:35 +0100 Subject: [PATCH 1/3] Added typings for react-router-bootstrap --- react-bootstrap/react-bootstrap-tests.tsx | 7 ++++ react-bootstrap/react-router-bootstrap.d.ts | 46 +++++++++++++++++++++ 2 files changed, 53 insertions(+) create mode 100644 react-bootstrap/react-router-bootstrap.d.ts diff --git a/react-bootstrap/react-bootstrap-tests.tsx b/react-bootstrap/react-bootstrap-tests.tsx index 8b0dd0fc0..f5b4e0a6e 100644 --- a/react-bootstrap/react-bootstrap-tests.tsx +++ b/react-bootstrap/react-bootstrap-tests.tsx @@ -1,6 +1,7 @@ // React-Bootstrap Test // ================================================================================ /// +/// /// // Imports @@ -8,6 +9,7 @@ import * as React from 'react'; import { Component, CSSProperties } from 'react'; import { Button, ButtonToolbar, Modal, Well, ButtonGroup, DropdownButton, MenuItem, Panel, ListGroup, ListGroupItem, Accordion, Tooltip, OverlayTrigger, Popover, ProgressBar, Nav, NavItem, Navbar, NavDropdown, Tabs, Tab, Pager, PageItem, Pagination, Alert, Carousel, CarouselItem, Grid, Row, Col, Thumbnail, Label, Badge, Jumbotron, PageHeader, Glyphicon, Table, Input, ButtonInput } from 'react-bootstrap'; +import { LinkContainer, IndexLinkContainer } from 'react-router-bootstrap' export class ReactBootstrapTest extends Component { @@ -892,6 +894,11 @@ export class ReactBootstrapTest extends Component { + +
+ + +
); } diff --git a/react-bootstrap/react-router-bootstrap.d.ts b/react-bootstrap/react-router-bootstrap.d.ts new file mode 100644 index 000000000..c268a4ad4 --- /dev/null +++ b/react-bootstrap/react-router-bootstrap.d.ts @@ -0,0 +1,46 @@ +// Type definitions for react-router-bootstrap +// Project: https://github.com/react-bootstrap/react-router-bootstrap +// Definitions by: Vincent Lesierse +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// +/// + +declare namespace ReactRouterBootstrap { + // Import React + import React = __React; + + interface LinkContainerProps extends ReactRouter.LinkProps { + disabled?: boolean + } + interface LinkContainer extends React.ComponentClass {} + interface LinkContainerElement extends React.ReactElement {} + 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 + } + +} From 3408d9ad072960ff0c77bc8b93b1fea31a0aea5f Mon Sep 17 00:00:00 2001 From: Vincent Lesierse Date: Mon, 28 Dec 2015 08:41:44 +0100 Subject: [PATCH 2/3] Moved react-router-bootstrap to it's own directory --- .../react-router-bootstrap-tests.tsx | 32 +++++++++++++++++++ .../react-router-bootstrap.d.ts | 0 2 files changed, 32 insertions(+) create mode 100644 react-router-bootstrap/react-router-bootstrap-tests.tsx rename {react-bootstrap => react-router-bootstrap}/react-router-bootstrap.d.ts (100%) diff --git a/react-router-bootstrap/react-router-bootstrap-tests.tsx b/react-router-bootstrap/react-router-bootstrap-tests.tsx new file mode 100644 index 000000000..0211e97e7 --- /dev/null +++ b/react-router-bootstrap/react-router-bootstrap-tests.tsx @@ -0,0 +1,32 @@ +// React-Router-Bootstrap Test +// ================================================================================ +/// +/// +/// + +// 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 { + callback() { + alert('Callback: ' + JSON.stringify(arguments)); + } + + public render() { + let style: CSSProperties = { padding: '50px' }; + return ( +
+ +
+ + +
+
+ ); + } +} diff --git a/react-bootstrap/react-router-bootstrap.d.ts b/react-router-bootstrap/react-router-bootstrap.d.ts similarity index 100% rename from react-bootstrap/react-router-bootstrap.d.ts rename to react-router-bootstrap/react-router-bootstrap.d.ts From 0b6c7d2b8d618fa01a8b2d0fd7ffbabb5f133c1d Mon Sep 17 00:00:00 2001 From: Vincent Lesierse Date: Mon, 28 Dec 2015 08:44:51 +0100 Subject: [PATCH 3/3] Removed test from React-Bootstrap --- react-bootstrap/react-bootstrap-tests.tsx | 7 ------- 1 file changed, 7 deletions(-) diff --git a/react-bootstrap/react-bootstrap-tests.tsx b/react-bootstrap/react-bootstrap-tests.tsx index f5b4e0a6e..8b0dd0fc0 100644 --- a/react-bootstrap/react-bootstrap-tests.tsx +++ b/react-bootstrap/react-bootstrap-tests.tsx @@ -1,7 +1,6 @@ // React-Bootstrap Test // ================================================================================ /// -/// /// // Imports @@ -9,7 +8,6 @@ import * as React from 'react'; import { Component, CSSProperties } from 'react'; import { Button, ButtonToolbar, Modal, Well, ButtonGroup, DropdownButton, MenuItem, Panel, ListGroup, ListGroupItem, Accordion, Tooltip, OverlayTrigger, Popover, ProgressBar, Nav, NavItem, Navbar, NavDropdown, Tabs, Tab, Pager, PageItem, Pagination, Alert, Carousel, CarouselItem, Grid, Row, Col, Thumbnail, Label, Badge, Jumbotron, PageHeader, Glyphicon, Table, Input, ButtonInput } from 'react-bootstrap'; -import { LinkContainer, IndexLinkContainer } from 'react-router-bootstrap' export class ReactBootstrapTest extends Component { @@ -894,11 +892,6 @@ export class ReactBootstrapTest extends Component { - -
- - -
); }