From 2682d3a8bac09468953ad1dd39c691c570381e42 Mon Sep 17 00:00:00 2001 From: Walker Burgin Date: Tue, 18 Aug 2015 23:57:07 -0700 Subject: [PATCH 1/5] Update definition to support instantiating StaticLocation --- react-router/react-router.d.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/react-router/react-router.d.ts b/react-router/react-router.d.ts index d8dd12c97..e0b1fb0f7 100644 --- a/react-router/react-router.d.ts +++ b/react-router/react-router.d.ts @@ -175,6 +175,7 @@ declare module ReactRouter { function create(options: RouterCreateOption): Router; function run(routes: Route, callback: RouterRunCallback): Router; function run(routes: Route, location: LocationBase, callback: RouterRunCallback): Router; + function run(routes: Route, location: string, callback: RouterRunCallback): Router; // @@ -198,7 +199,9 @@ declare module ReactRouter { interface HashLocation extends Location, LocationListener { } interface HistoryLocation extends Location, LocationListener { } interface RefreshLocation extends Location { } - interface StaticLocation extends LocationBase { } + interface StaticLocation extends LocationBase { + new(path: string): StaticLocation + } interface TestLocation extends Location, LocationListener { } var HashLocation: HashLocation; From 9703d2138d17fd6c3878e996f05c6b366c6bd985 Mon Sep 17 00:00:00 2001 From: Walker Burgin Date: Thu, 20 Aug 2015 22:58:58 -0700 Subject: [PATCH 2/5] Relax type checking on route properties --- react-router/react-router.d.ts | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/react-router/react-router.d.ts b/react-router/react-router.d.ts index e0b1fb0f7..b58b2f7cb 100644 --- a/react-router/react-router.d.ts +++ b/react-router/react-router.d.ts @@ -67,14 +67,8 @@ declare module ReactRouter { interface RedirectClass extends React.ComponentClass {} // Route - interface RouteProp { - name?: string; - path?: string; - handler?: React.ComponentClass; - ignoreScrollBehavior?: boolean; - } - interface Route extends React.ReactElement {} - interface RouteClass extends React.ComponentClass {} + interface Route extends React.ReactElement {} + interface RouteClass extends React.ComponentClass {} var DefaultRoute: DefaultRouteClass; var NotFoundRoute: NotFoundRouteClass; @@ -310,7 +304,7 @@ declare module __React { // for Route function createElement( type: ReactRouter.RouteClass, - props: ReactRouter.RouteProp, + props: any, ...children: __React.ReactNode[]): ReactRouter.Route; // for RouteHandler @@ -348,7 +342,7 @@ declare module "react/addons" { // for Route function createElement( type: ReactRouter.RouteClass, - props: ReactRouter.RouteProp, + props: any, ...children: __React.ReactNode[]): ReactRouter.Route; // for RouteHandler From cf5c5f6f9a1dd433610d13d32f1d30da9f559fe3 Mon Sep 17 00:00:00 2001 From: Walker Burgin Date: Mon, 7 Sep 2015 01:54:46 -0700 Subject: [PATCH 3/5] Add react-bootstrap type definition --- react-bootstrap/react-bootstrap-test.tsx | 898 ++++++++++++++++++++++ react-bootstrap/react-bootstrap.d.ts | 903 +++++++++++++++++++++++ 2 files changed, 1801 insertions(+) create mode 100644 react-bootstrap/react-bootstrap-test.tsx create mode 100644 react-bootstrap/react-bootstrap.d.ts diff --git a/react-bootstrap/react-bootstrap-test.tsx b/react-bootstrap/react-bootstrap-test.tsx new file mode 100644 index 000000000..cdb1c7bae --- /dev/null +++ b/react-bootstrap/react-bootstrap-test.tsx @@ -0,0 +1,898 @@ +// React-Bootstrap Test +// ================================================================================ +/// +/// + +// Imports +// -------------------------------------------------------------------------------- +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'; + + +export class ReactBootstrapTest extends Component { + callback() { + alert('Callback: ' + JSON.stringify(arguments)); + } + + public render() { + let style: CSSProperties = { padding: '50px' }; + let tooltip = (Holy guacamole! Check this info.); + + const innerGlyphicon = ; + const innerButton = ; + const innerDropdown = ( + + Item + + ); + const innerRadio = ; + const innerCheckbox = ; + + return ( +
+
+ + + + + + + + + +
+ +
+ + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ +
+ + + + +
+ + +
+ + + + +
+ + +
+ + + + + +
+ + +
+ + + + + + + + + + + + + + + + +
+ + // TODO: Start here + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + Dropdown link + Dropdown link + + + + + Dropdown link + Dropdown link + + + Dropdown link + Dropdown link + + +
+ +
+ + Action + Another action + Active Item + + Separated link + +
+ +
+
+
    + Header + link + + Header + link + disabled + + link with title + + + link that alerts + +
+
+
+ +
+ + Basic panel example + +
+ +
+
+ + Panel content + + + Panel content + +
+
+ +
+ + Panel content + +
+ +
+
+ + Panel content + + + + Panel content + + + + Panel content + + + + Panel content + + + + Panel content + + + + Panel content + +
+
+ +
+ + Some default panel content here. + + Item 1 + Item 2 + + + Some more panel content here. + +
+ +
+ + + 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. + + + 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. + + + 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. + + +
+ +
+
+ + + Modal title + + + + One fine body... + + + + + + + + +
+
+ +
+
+ + Tooltip right + + + + Tooltip top + + + + Tooltip left + + + + Tooltip bottom + +
+
+ +
+ + + + + + + + + + + + + + + + + +
+ +
+
+ + And here's some amazing content. It's very engaging. right? + +
+
+ +
+ + Holy guacamole! Check this info.}> + + + Holy guacamole! Check this info.}> + + + Holy guacamole! Check this info.}> + + + Holy guacamole! Check this info.}> + + + +
+ +
+ + Holy guacamole! Check this info.}> + + + Holy guacamole! Check this info.}> + + + Holy guacamole! Check this info.}> + + + Holy guacamole! Check this info.}> + + + +
+ +
+ +
+ +
+ +
+ +
+
+ + + + +
+
+ +
+
+ + + + +
+
+ +
+ +
+ +
+ + + + + +
+ +
+ +
+ +
+ +
+ +
+
+ +
+ +
+
+ +
+ + + +
+ +
+ + + +
+ +
+ + Previous + Next + +
+ +
+ + Tab 1 content + Tab 2 content + Tab 3 content + +
+ +
+ + Previous + Next + +
+ +
+ + ← Previous Page + Next Page → + +
+ +
+ + ← Previous + Next → + +
+ +
+
+ +
+ +
+ + +
+
+ +
+ + Holy guacamole! Best check yo self, you're not looking too good. + +
+ +
+ + + 900x500 +
+

First slide label

+

Nulla vitae elit libero, a pharetra augue mollis interdum.

+
+
+ + 900x500 +
+

Second slide label

+

Lorem ipsum dolor sit amet, consectetur adipiscing elit.

+
+
+ + 900x500 +
+

Third slide label

+

Praesent commodo cursus magna, vel scelerisque nisl consectetur.

+
+
+
+
+ +
+ + + <{'Col xs={12} md={8}'} /> + <{'Col xs={6} md={4}'} /> + + + + <{'Col xs={6} md={4}'} /> + <{'Col xs={6} md={4}'} /> + <{'Col xs={6} md={4}'} /> + + + + <{'Col xs={6} xsOffset={6}'} /> + + + + <{'Col md={6} mdPush={6}'} /> + <{'Col md={6} mdPull={6}'} /> + + +
+ +
+ + + + + + + + + + + + + +
+ +
+ + Item 1 + Item 2 + ... + +
+ +
+ + Link 1 + Link 2 + + Trigger an alert + + +
+ +
+ + Link 1 + Link 2 + Link 3 + +
+ +
+ + Success + Info + Warning + Danger + +
+ +
+ + Some body text + Linked item + Danger styling + +
+ +
+
+

Label

+

Label

+

Label

+

Label

+
Label
+

Label

+
+
+ +
+
+   +   +   +   +   + +
+
+ +
+

Badges 42

+
+ +
+ +

Hello, world!

+

This is a simple hero unit, a simple jumbotron-style component for calling extra attention to featured content or information.

+

+
+
+ +
+ Example page header Subtext for header +
+ +
+ Look I'm in a well! +
+ +
+
+ Look I'm in a large well! + Look I'm in a small well! +
+
+ +
+
+ + + + + + + + + + + + + + + + +
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NumberFirst NameLast NameUsername
1MarkOtto@mdo
2JacobThornton@fat
3Larry the Bird@twitter
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NumberTable headingTable headingTable headingTable headingTable headingTable heading
1Table cellTable cellTable cellTable cellTable cellTable cell
2Table cellTable cellTable cellTable cellTable cellTable cell
3Table cellTable cellTable cellTable cellTable cellTable cell
+
+ +
+ +
+ +
+
+ + + + + + + + + + + + + + + + + + + +
+ +
+
+ + Child Text + + + +
+ +
+
+ + + + + + + + +
+
+ +
+
+ + + +
+
+ +
+
+ + + +
+
+ +
+
+ + + +
+
+ +
+ + + + + + + + + + +
+
+ ); + } +} diff --git a/react-bootstrap/react-bootstrap.d.ts b/react-bootstrap/react-bootstrap.d.ts new file mode 100644 index 000000000..51a5a6da1 --- /dev/null +++ b/react-bootstrap/react-bootstrap.d.ts @@ -0,0 +1,903 @@ +// Type definitions for react-bootstrap +// Project: https://github.com/react-bootstrap/react-bootstrap +// Definitions by: Walker Burgin +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// +/// + +declare module "react-bootstrap" { + // Import React + import React = require("react"); + + + //