├── .gitignore ├── .vscode ├── settings.json └── tasks.json ├── LICENSE ├── Procfile ├── README.md ├── index.html ├── package.json ├── server.js ├── src ├── AppState.ts ├── components │ ├── App │ │ └── index.tsx │ ├── ContactDetails │ │ └── index.tsx │ ├── ContactList │ │ ├── ContactListDivider.tsx │ │ ├── ContactListItem.tsx │ │ └── index.tsx │ ├── EditContact │ │ └── index.tsx │ ├── Empty │ │ └── index.tsx │ ├── ProfilePicture │ │ └── index.tsx │ ├── SearchBox │ │ └── index.tsx │ └── index.tsx ├── favicon.ico ├── index.tsx └── interfaces │ ├── Contact.ts │ └── index.tsx ├── tsconfig.json ├── tsd.json ├── typings ├── react-router │ ├── history.d.ts │ └── react-router.d.ts ├── react │ ├── react-dom.d.ts │ └── react.d.ts └── tsd.d.ts └── webpack.config.js /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | .DS_Store 3 | dist/ 4 | *.log -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | // Place your settings in this file to overwrite default and user settings. 2 | { 3 | "editor.tabSize": 2, 4 | "editor.insertSpaces": true 5 | } 6 | -------------------------------------------------------------------------------- /.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | // Available variables which can be used inside of strings. 2 | // ${workspaceRoot}: the root folder of the team 3 | // ${file}: the current opened file 4 | // ${fileBasename}: the current opened file's basename 5 | // ${fileDirname}: the current opened file's dirname 6 | // ${fileExtname}: the current opened file's extension 7 | // ${cwd}: the current working directory of the spawned process 8 | 9 | // A task runner that calls the Typescript compiler (tsc) and 10 | // Compiles a HelloWorld.ts program 11 | { 12 | "version": "0.1.0", 13 | 14 | // The command is tsc. Assumes that tsc has been installed using npm install -g typescript 15 | "command": "npm", 16 | 17 | // The command is a shell script 18 | "isShellCommand": true, 19 | 20 | // Show the output window only if unrecognized errors occur. 21 | "showOutput": "always", 22 | 23 | // args is the HelloWorld program to compile. 24 | "args": ["run", "build"], 25 | 26 | // use the standard tsc problem matcher to find compile problems 27 | // in the output. 28 | "problemMatcher": "$tsc" 29 | } 30 | 31 | // A task runner that calls the Typescript compiler (tsc) and 32 | // compiles based on a tsconfig.json file that is present in 33 | // the root of the folder open in VSCode 34 | /* 35 | { 36 | "version": "0.1.0", 37 | 38 | // The command is tsc. Assumes that tsc has been installed using npm install -g typescript 39 | "command": "tsc", 40 | 41 | // The command is a shell script 42 | "isShellCommand": true, 43 | 44 | // Show the output window only if unrecognized errors occur. 45 | "showOutput": "silent", 46 | 47 | // Tell the tsc compiler to use the tsconfig.json from the open folder. 48 | "args": ["-p", "."], 49 | 50 | // use the standard tsc problem matcher to find compile problems 51 | // in the output. 52 | "problemMatcher": "$tsc" 53 | } 54 | */ 55 | 56 | // A task runner configuration for gulp. Gulp provides a less task 57 | // which compiles less to css. 58 | /* 59 | { 60 | "version": "0.1.0", 61 | "command": "gulp", 62 | "isShellCommand": true, 63 | "tasks": [ 64 | { 65 | "taskName": "less", 66 | // Make this the default build command. 67 | "isBuildCommand": true, 68 | // Show the output window only if unrecognized errors occur. 69 | "showOutput": "silent", 70 | // Use the standard less compilation problem matcher. 71 | "problemMatcher": "$lessCompile" 72 | } 73 | ] 74 | } 75 | */ 76 | 77 | // Uncomment the following section to use jake to build a workspace 78 | // cloned from https://github.com/Microsoft/TypeScript.git 79 | /* 80 | { 81 | "version": "0.1.0", 82 | // Task runner is jake 83 | "command": "jake", 84 | // Need to be executed in shell / cmd 85 | "isShellCommand": true, 86 | "showOutput": "silent", 87 | "tasks": [ 88 | { 89 | // TS build command is local. 90 | "taskName": "local", 91 | // Make this the default build command. 92 | "isBuildCommand": true, 93 | // Show the output window only if unrecognized errors occur. 94 | "showOutput": "silent", 95 | // Use the redefined Typescript output problem matcher. 96 | "problemMatcher": [ 97 | "$tsc" 98 | ] 99 | } 100 | ] 101 | } 102 | */ 103 | 104 | // Uncomment the section below to use msbuild and generate problems 105 | // for csc, cpp, tsc and vb. The configuration assumes that msbuild 106 | // is available on the path and a solution file exists in the 107 | // workspace folder root. 108 | /* 109 | { 110 | "version": "0.1.0", 111 | "command": "msbuild", 112 | "args": [ 113 | // Ask msbuild to generate full paths for file names. 114 | "/property:GenerateFullPaths=true" 115 | ], 116 | "taskSelector": "/t:", 117 | "showOutput": "silent", 118 | "tasks": [ 119 | { 120 | "taskName": "build", 121 | // Show the output window only if unrecognized errors occur. 122 | "showOutput": "silent", 123 | // Use the standard MS compiler pattern to detect errors, warnings 124 | // and infos in the output. 125 | "problemMatcher": "$msCompile" 126 | } 127 | ] 128 | } 129 | */ 130 | 131 | // Uncomment the following section to use msbuild which compiles Typescript 132 | // and less files. 133 | /* 134 | { 135 | "version": "0.1.0", 136 | "command": "msbuild", 137 | "args": [ 138 | // Ask msbuild to generate full paths for file names. 139 | "/property:GenerateFullPaths=true" 140 | ], 141 | "taskSelector": "/t:", 142 | "showOutput": "silent", 143 | "tasks": [ 144 | { 145 | "taskName": "build", 146 | // Show the output window only if unrecognized errors occur. 147 | "showOutput": "silent", 148 | // Use the standard MS compiler pattern to detect errors, warnings 149 | // and infos in the output. 150 | "problemMatcher": [ 151 | "$msCompile", 152 | "$lessCompile" 153 | ] 154 | } 155 | ] 156 | } 157 | */ 158 | // A task runner example that defines a problemMatcher inline instead of using 159 | // a predfined one. 160 | /* 161 | { 162 | "version": "0.1.0", 163 | "command": "tsc", 164 | "isShellCommand": true, 165 | "args": ["HelloWorld.ts"], 166 | "showOutput": "silent", 167 | "problemMatcher": { 168 | // The problem is owned by the typescript language service. Ensure that the problems 169 | // are merged with problems produced by Visual Studio's language service. 170 | "owner": "typescript", 171 | // The file name for reported problems is relative to the current working directory. 172 | "fileLocation": ["relative", "${cwd}"], 173 | // The actual pattern to match problems in the output. 174 | "pattern": { 175 | // The regular expression. Matches HelloWorld.ts(2,10): error TS2339: Property 'logg' does not exist on type 'Console'. 176 | "regexp": "^([^\\s].*)\\((\\d+|\\d+,\\d+|\\d+,\\d+,\\d+,\\d+)\\):\\s+(error|warning|info)\\s+(TS\\d+)\\s*:\\s*(.*)$", 177 | // The match group that denotes the file containing the problem. 178 | "file": 1, 179 | // The match group that denotes the problem location. 180 | "location": 2, 181 | // The match group that denotes the problem's severity. Can be omitted. 182 | "severity": 3, 183 | // The match group that denotes the problem code. Can be omitted. 184 | "code": 4, 185 | // The match group that denotes the problem's message. 186 | "message": 5 187 | } 188 | } 189 | } 190 | */ -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Michel Weststrate 4 | Forked from: https://github.com/bvanreeven/react-typescript 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | SOFTWARE. 23 | 24 | -------------------------------------------------------------------------------- /Procfile: -------------------------------------------------------------------------------- 1 | node: npm start 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Contacts MVC MobX/React 2 | 3 | A simple contact manager web application that uses MobX, React, React-Router, Express and TypeScript 4 | 5 | **[Run the live demo](https://contacts-mvc-mobx-react-ts.herokuapp.com/)** - runs on a Heroku free instance, might take a while to load 6 | 7 | Features: 8 | * **Server side rendering** 9 | * **JavaScript quick state transfer based navigation** 10 | * **MobX Observable architecture** 11 | 12 | ##Initial run: 13 | 14 | * Install Node.js 15 | * `npm install` 16 | * `npm start` 17 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Contacts 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "mobx-react-typescript-boilerplate", 3 | "version": "1.0.0", 4 | "description": "Boilerplate for MobX + React project with Typescript, ES6 compilation and hot code reloading", 5 | "scripts": { 6 | "start": "node server.js" 7 | }, 8 | "repository": { 9 | "type": "git", 10 | "url": "https://github.com/mobxjs/mobx-react-typescript-boilerplate.git" 11 | }, 12 | "keywords": [ 13 | "react", 14 | "reactjs", 15 | "boilerplate", 16 | "mobx", 17 | "starter-kit" 18 | ], 19 | "authors": [ 20 | "Mohsen Azimi " 21 | ], 22 | "license": "MIT", 23 | "bugs": { 24 | "url": "https://github.com/mobxjs/mobx/issues" 25 | }, 26 | "homepage": "http://mobxjs.github.com/mobx", 27 | "dependencies": { 28 | "classnames": "^2.2.5", 29 | "contacts-mvc-css": "^1.4.0", 30 | "contacts-mvc-data": "^2.3.0", 31 | "json-loader": "^0.5.4", 32 | "mobx": "^2.5.1", 33 | "mobx-react": "^3.5.5", 34 | "mobx-react-devtools": "^4.2.5", 35 | "react": "^15.3.1", 36 | "react-dom": "^15.3.1", 37 | "react-hot-loader": "^3.0.0-beta.3", 38 | "react-router": "^2.7.0", 39 | "reset-css": "^2.0.2011012603", 40 | "style-loader": "^0.13.1", 41 | "ts-loader": "^0.8.2", 42 | "typescript": "^1.8.10", 43 | "webpack": "^1.13.2", 44 | "webpack-dev-server": "^1.15.1" 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /server.js: -------------------------------------------------------------------------------- 1 | var webpack = require('webpack'); 2 | var WebpackDevServer = require('webpack-dev-server'); 3 | var config = require('./webpack.config'); 4 | 5 | var PORT = process.env.PORT || 3000; 6 | 7 | new WebpackDevServer(webpack(config), { 8 | publicPath: config.output.publicPath, 9 | hot: true, 10 | quiet: true, 11 | historyApiFallback: true 12 | }).listen(PORT, function (err, result) { 13 | if (err) { 14 | console.log(err); 15 | } 16 | 17 | console.log('Listening at http://localhost:' + PORT); 18 | }); 19 | -------------------------------------------------------------------------------- /src/AppState.ts: -------------------------------------------------------------------------------- 1 | import {observable, computed, action, useStrict} from 'mobx'; 2 | import * as CONTACTS from 'contacts-mvc-data'; 3 | import {Contact} from './interfaces'; 4 | 5 | useStrict(true); 6 | 7 | export class AppState { 8 | @observable public selectedContact: Contact = null 9 | @observable public contacts: Array = CONTACTS as any; 10 | @observable public searchQuery: string = ''; 11 | 12 | @computed 13 | get filteredContacts() { 14 | if (!this.searchQuery) { 15 | return this.contacts; 16 | } 17 | 18 | return this.contacts.filter(contact=> match(contact, this.searchQuery)); 19 | 20 | function match(contact: Contact, query: string): boolean { 21 | return contains(contact.firstName, query) || contains(contact.lastName, query); 22 | } 23 | function contains(str: string = '', query: string = ''): boolean { 24 | return str.toLocaleLowerCase().indexOf(query.toLocaleLowerCase()) > -1; 25 | } 26 | } 27 | 28 | @action 29 | selectContact(contact: Contact): void { 30 | this.selectedContact = contact; 31 | } 32 | 33 | @action 34 | search(query: string): void { 35 | this.searchQuery = query; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/components/App/index.tsx: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | import {observer} from 'mobx-react'; 3 | import DevTools from 'mobx-react-devtools'; 4 | 5 | import {SearchBox, ContactList} from '../'; 6 | 7 | @observer 8 | export class App extends React.Component<{children: any, params: any}, {}> { 9 | render() { 10 | return ( 11 |
12 |
13 |
14 | 18 | {this.props.children} 19 |
20 |
21 | 22 |
23 | ); 24 | } 25 | }; -------------------------------------------------------------------------------- /src/components/ContactDetails/index.tsx: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | import {Component} from 'react'; 3 | import {observer, inject} from 'mobx-react'; 4 | import {browserHistory, Link} from 'react-router'; 5 | 6 | import {Empty} from '../Empty'; 7 | import {Contact} from '../../interfaces'; 8 | import {ProfilePicture} from '../ProfilePicture'; 9 | import {AppState} from '../..'; 10 | 11 | @inject('appState') 12 | @observer 13 | export class ContactDetails extends Component<{appState: AppState}, {}> { 14 | 15 | formatPhoneNumber(raw: string): string { 16 | return `(${raw.substr(0, 3)}) ${raw.substr(3,3)}-${raw.substr(6)}`; 17 | } 18 | 19 | render() { 20 | const contact = this.props.appState.selectedContact; 21 | 22 | if (!contact) { 23 | return 24 | } 25 | 26 | return ( 27 |
28 |
29 | 30 |
31 |

{contact.firstName} {contact.lastName}

32 |
33 |
34 | 35 | 36 | 37 | 38 | 39 | 40 |
41 |
42 |
43 | 44 |
45 |
46 | 47 | Edit 48 |
49 |
50 |
51 | ) 52 | } 53 | } 54 | 55 | function TableRow({label, value}) { 56 | if (!value) { 57 | return ; 58 | } 59 | return 60 | {label} 61 | {value} 62 | 63 | } 64 | -------------------------------------------------------------------------------- /src/components/ContactList/ContactListDivider.tsx: -------------------------------------------------------------------------------- 1 | import {Component} from 'react'; 2 | import * as React from 'react'; 3 | import {observer} from 'mobx-react'; 4 | 5 | @observer 6 | export class ContactListDivider extends Component<{charchtar: string}, {}> { 7 | render() { 8 | return (
  • {this.props.charchtar}
  • ); 9 | } 10 | } -------------------------------------------------------------------------------- /src/components/ContactList/ContactListItem.tsx: -------------------------------------------------------------------------------- 1 | import {Component} from 'react'; 2 | import * as React from 'react'; 3 | import {observer, inject} from 'mobx-react'; 4 | import {browserHistory} from 'react-router'; 5 | 6 | import {AppState} from '../..'; 7 | 8 | declare const require; 9 | const classnames = require('classnames'); 10 | 11 | @inject('appState') 12 | @observer 13 | export class ContactListItem extends Component<{appState?: AppState, contact: any; isSelected: boolean}, {}> { 14 | selectContact() { 15 | browserHistory.push('/' + this.props.contact.id); 16 | this.props.appState.selectContact(this.props.contact); 17 | } 18 | render() { 19 | const contact = this.props.contact; 20 | return (
  • 23 | {contact.firstName} {contact.lastName} 24 |
  • ); 25 | } 26 | } -------------------------------------------------------------------------------- /src/components/ContactList/index.tsx: -------------------------------------------------------------------------------- 1 | import {Component} from 'react'; 2 | import * as React from 'react'; 3 | import {observer, inject} from 'mobx-react'; 4 | import {computed} from 'mobx'; 5 | 6 | import Contact from '../../interfaces/Contact'; 7 | 8 | import {AppState} from '../..'; 9 | import {ContactListItem} from './ContactListItem'; 10 | import {ContactListDivider} from './ContactListDivider'; 11 | 12 | class Divider { 13 | public isDivider: boolean = true; 14 | public id: string; 15 | constructor (public charchtar: string) { 16 | this.id = Math.random().toString(36); 17 | } 18 | } 19 | 20 | @inject('appState') 21 | @observer 22 | export class ContactList extends Component<{appState?: AppState}, {}> { 23 | 24 | get contactsAndDividers(): Array { 25 | const contacts = this.props.appState.filteredContacts; 26 | const result: Array = []; 27 | 28 | if (!contacts.length) return []; 29 | 30 | result.push(new Divider(contacts[0].firstName.charAt(0))); 31 | 32 | for (let i = 0; i < contacts.length; i++) { 33 | const element = contacts[i]; 34 | const nextElement = contacts[i+1]; 35 | 36 | result.push(element); 37 | 38 | if (nextElement && (nextElement.firstName.charAt(0) !== element.firstName.charAt(0))) { 39 | result.push(new Divider(nextElement.firstName.charAt(0))); 40 | } 41 | } 42 | 43 | return result; 44 | } 45 | 46 | render() { 47 | return ( 48 |
    49 |
      50 | {this.contactsAndDividers.map(item => { 51 | if (item instanceof Divider) { 52 | return 53 | } 54 | const contact = item as Contact; 55 | return 59 | })} 60 |
    61 |
    62 | ); 63 | } 64 | } -------------------------------------------------------------------------------- /src/components/EditContact/index.tsx: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | import {Component} from 'react'; 3 | import {observer, inject} from 'mobx-react'; 4 | import {browserHistory, Link} from 'react-router'; 5 | 6 | import {AppState} from '../..'; 7 | import {ProfilePicture} from '../ProfilePicture'; 8 | 9 | @inject('appState') 10 | @observer 11 | export class EditContact extends Component<{appState?: AppState, isNew?: boolean}, {}> { 12 | 13 | formatPhoneNumber(raw: string): string { 14 | return `(${raw.substr(0, 3)}) ${raw.substr(3,3)}-${raw.substr(6)}`; 15 | } 16 | 17 | quit() { 18 | if (this.props.isNew) { 19 | return browserHistory.push('/'); 20 | } 21 | browserHistory.push('/' + this.props.appState.selectedContact.id); 22 | } 23 | 24 | save() { 25 | console.log(this); 26 | this.quit(); 27 | } 28 | 29 | changed() { 30 | // TODO 31 | } 32 | 33 | render() { 34 | const contact = this.props.appState.selectedContact; 35 | 36 | if (!contact) { 37 | return
    38 | } 39 | 40 | return ( 41 |
    42 |
    43 |
    44 | 45 | 46 |
    47 |
    48 |

    49 | 50 |   51 | 52 |

    53 |
    54 |
    55 | 56 | 57 | 58 | 59 | 62 | 63 | 64 | 65 | 68 | 69 | 70 | 71 | 74 | 75 | 76 |
    email 60 | 61 |
    phone 66 | 67 |
    address 72 | 73 |
    77 |
    78 |
    79 |
    80 |
    81 | 82 | 83 |
    84 |
    85 |
    86 | ) 87 | } 88 | } -------------------------------------------------------------------------------- /src/components/Empty/index.tsx: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | import {Component} from 'react'; 3 | import {observer} from 'mobx-react'; 4 | import {Link, browserHistory} from 'react-router'; 5 | 6 | import Contact from '../../interfaces/Contact'; 7 | 8 | export class Empty extends Component<{params}, {}> { 9 | render() { 10 | return
    11 | Select a contact from the list or create a new one. 12 |
    ; 13 | } 14 | } -------------------------------------------------------------------------------- /src/components/ProfilePicture/index.tsx: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | import {Component} from 'react'; 3 | import {computed} from 'mobx'; 4 | import {observer, inject} from 'mobx-react'; 5 | 6 | import Contact from '../../interfaces/Contact'; 7 | 8 | @observer 9 | export class ProfilePicture extends Component<{contact: Contact}, {}> { 10 | 11 | get initials(): string { 12 | const contact = this.props.contact; 13 | let initials = ''; 14 | 15 | if (contact.firstName) { 16 | // TODO: use unicode code point 17 | // initials += String.fromCodePoint(contact.firstName.charCodeAt(0)); 18 | initials += contact.firstName.charAt(0); 19 | } 20 | 21 | if (contact.lastName) { 22 | initials += contact.lastName.charAt(0); 23 | } 24 | 25 | return initials; 26 | } 27 | 28 | get profilePictureUrl(): string { 29 | const contact = this.props.contact; 30 | 31 | if (contact.picture) { 32 | return contact.picture.url; 33 | } 34 | 35 | return null; 36 | } 37 | 38 | render() { 39 | let inner = null; 40 | 41 | if (this.profilePictureUrl) { 42 | inner = 43 | } else { 44 | inner = (
    {this.initials}
    ) 45 | } 46 | 47 | return (
    {inner}
    ); 48 | } 49 | } -------------------------------------------------------------------------------- /src/components/SearchBox/index.tsx: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | import {Component} from 'react'; 3 | import {observer, inject} from 'mobx-react'; 4 | import {browserHistory} from 'react-router'; 5 | 6 | import {Contact} from '../../interfaces'; 7 | import {AppState} from '../..'; 8 | 9 | @inject('appState') 10 | @observer 11 | export class SearchBox extends Component<{params: {query: string}, appState?: AppState},{}> { 12 | shouldAutoFocus: boolean = false; 13 | 14 | componentWillMount() { 15 | if (this.props.params.query) { 16 | this.props.appState.search(this.props.params.query); 17 | this.shouldAutoFocus = true; 18 | } 19 | } 20 | 21 | componentDidMount() { 22 | const refs = this.refs as any; 23 | 24 | if (this.shouldAutoFocus) { 25 | 26 | // TODO: move the blinker to the end when focusing (using selection range trick) 27 | refs.searchInput.focus(); 28 | } 29 | } 30 | 31 | searchChanged(event: React.SyntheticEvent) { 32 | const target = event.target as HTMLInputElement; 33 | const query = target.value; 34 | this.props.appState.search(query); 35 | browserHistory.replace(`/search/${query}`); 36 | } 37 | 38 | endSeach() { 39 | if (!this.props.appState.searchQuery) { 40 | this.props.appState.selectedContact = null; 41 | browserHistory.replace('/'); 42 | } 43 | } 44 | 45 | render() { 46 | const appState = this.props.appState; 47 | return ( 48 |
    49 | 56 |
    57 | ); 58 | } 59 | } -------------------------------------------------------------------------------- /src/components/index.tsx: -------------------------------------------------------------------------------- 1 | export {App} from './App'; 2 | export {ContactList} from './ContactList'; 3 | export {ContactDetails} from './ContactDetails'; 4 | export {EditContact} from './EditContact'; 5 | export {SearchBox} from './SearchBox'; 6 | export {Empty} from './Empty'; 7 | -------------------------------------------------------------------------------- /src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/contacts-mvc/mobx-react-typescript/93dd4ca86e8d33f242b0eb7c49b0504f9593c6a9/src/favicon.ico -------------------------------------------------------------------------------- /src/index.tsx: -------------------------------------------------------------------------------- 1 | import {Component} from 'react'; 2 | import * as React from 'react'; 3 | import * as ReactDOM from 'react-dom'; 4 | import {Provider} from 'mobx-react'; 5 | import {Router, Route, IndexRoute, browserHistory} from 'react-router'; 6 | 7 | import {App, ContactDetails, ContactList, EditContact, Empty, SearchBox} from './components'; 8 | import {AppState} from './AppState'; 9 | export {AppState} from './AppState'; // lazy 10 | 11 | const appState = new AppState(); 12 | 13 | 14 | ReactDOM.render( 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | , 26 | document.getElementById('root')); -------------------------------------------------------------------------------- /src/interfaces/Contact.ts: -------------------------------------------------------------------------------- 1 | interface Contact { 2 | id: string; 3 | firstName: string; 4 | lastName: string; 5 | picture: {url: string}; 6 | phoneNumber: string; 7 | email: string; 8 | address: string; 9 | } 10 | 11 | export class ContactClass implements Contact { 12 | public id: string; 13 | 14 | constructor( 15 | public firstName: string = '', 16 | public lastName: string = '', 17 | public picture: {url: string} = {url: ''}, 18 | public phoneNumber: string = '', 19 | public email: string = '', 20 | public address: string = '') { 21 | this.id = Math.random().toString(36).substring(2); 22 | } 23 | } 24 | 25 | export default Contact; -------------------------------------------------------------------------------- /src/interfaces/index.tsx: -------------------------------------------------------------------------------- 1 | export {default as Contact} from './Contact' -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5", 4 | "module": "commonjs", 5 | "declaration": false, 6 | "noImplicitAny": false, 7 | "removeComments": true, 8 | "experimentalDecorators": true, 9 | "noLib": false, 10 | "jsx": "react", 11 | "outDir": "dist" 12 | }, 13 | "exclude": [ 14 | "node_modules", 15 | "static" 16 | ] 17 | } 18 | -------------------------------------------------------------------------------- /tsd.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "v4", 3 | "repo": "borisyankov/DefinitelyTyped", 4 | "ref": "master", 5 | "path": "typings", 6 | "bundle": "typings/tsd.d.ts", 7 | "installed": { 8 | "react-router/react-router.d.ts": { 9 | "commit": "4ba57e605bd71bf7248de65aac0b4f50e3eb1c9e" 10 | }, 11 | "react-router/history.d.ts": { 12 | "commit": "4ba57e605bd71bf7248de65aac0b4f50e3eb1c9e" 13 | }, 14 | "react/react.d.ts": { 15 | "commit": "4ba57e605bd71bf7248de65aac0b4f50e3eb1c9e" 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /typings/react-router/history.d.ts: -------------------------------------------------------------------------------- 1 | // Type definitions for history v1.13.1 2 | // Project: https://github.com/rackt/history 3 | // Definitions by: Sergey Buturlakin 4 | // Definitions: https://github.com/borisyankov/DefinitelyTyped 5 | 6 | 7 | declare namespace HistoryModule { 8 | 9 | // types based on https://github.com/rackt/history/blob/master/docs/Terms.md 10 | 11 | type Action = string 12 | 13 | type BeforeUnloadHook = () => string | boolean 14 | 15 | type CreateHistory = (options?: HistoryOptions) => T 16 | 17 | type CreateHistoryEnhancer = (createHistory: CreateHistory) => CreateHistory 18 | 19 | interface History { 20 | listenBefore(hook: TransitionHook): Function 21 | listen(listener: LocationListener): Function 22 | transitionTo(location: Location): void 23 | pushState(state: LocationState, path: Path): void 24 | replaceState(state: LocationState, path: Path): void 25 | push(path: Path): void 26 | replace(path: Path): void 27 | go(n: number): void 28 | goBack(): void 29 | goForward(): void 30 | createKey(): LocationKey 31 | createPath(path: Path): Path 32 | createHref(path: Path): Href 33 | createLocation(path?: Path, state?: LocationState, action?: Action, key?: LocationKey): Location 34 | 35 | /** @deprecated use location.key to save state instead */ 36 | setState(state: LocationState): void 37 | /** @deprecated use listenBefore instead */ 38 | registerTransitionHook(hook: TransitionHook): void 39 | /** @deprecated use the callback returned from listenBefore instead */ 40 | unregisterTransitionHook(hook: TransitionHook): void 41 | } 42 | 43 | type HistoryOptions = Object 44 | 45 | type Href = string 46 | 47 | type Location = { 48 | pathname: Pathname 49 | search: QueryString 50 | query: Query 51 | state: LocationState 52 | action: Action 53 | key: LocationKey 54 | } 55 | 56 | type LocationKey = string 57 | 58 | type LocationListener = (location: Location) => void 59 | 60 | type LocationState = Object 61 | 62 | type Path = string // Pathname + QueryString 63 | 64 | type Pathname = string 65 | 66 | type Query = Object 67 | 68 | type QueryString = string 69 | 70 | type TransitionHook = (location: Location, callback: Function) => any 71 | 72 | 73 | interface HistoryBeforeUnload { 74 | listenBeforeUnload(hook: BeforeUnloadHook): Function 75 | } 76 | 77 | interface HistoryQueries { 78 | pushState(state: LocationState, pathname: Pathname | Path, query?: Query): void 79 | replaceState(state: LocationState, pathname: Pathname | Path, query?: Query): void 80 | createPath(path: Path, query?: Query): Path 81 | createHref(path: Path, query?: Query): Href 82 | } 83 | 84 | 85 | // Global usage, without modules, needs the small trick, because lib.d.ts 86 | // already has `history` and `History` global definitions: 87 | // var createHistory = ((window as any).History as HistoryModule.Module).createHistory; 88 | interface Module { 89 | createHistory: CreateHistory 90 | createHashHistory: CreateHistory 91 | createMemoryHistory: CreateHistory 92 | createLocation(path?: Path, state?: LocationState, action?: Action, key?: LocationKey): Location 93 | useBasename(createHistory: CreateHistory): CreateHistory 94 | useBeforeUnload(createHistory: CreateHistory): CreateHistory 95 | useQueries(createHistory: CreateHistory): CreateHistory 96 | actions: { 97 | PUSH: string 98 | REPLACE: string 99 | POP: string 100 | } 101 | } 102 | 103 | } 104 | 105 | 106 | declare module "history/lib/createBrowserHistory" { 107 | 108 | export default function createBrowserHistory(options?: HistoryModule.HistoryOptions): HistoryModule.History 109 | 110 | } 111 | 112 | 113 | declare module "history/lib/createHashHistory" { 114 | 115 | export default function createHashHistory(options?: HistoryModule.HistoryOptions): HistoryModule.History 116 | 117 | } 118 | 119 | 120 | declare module "history/lib/createMemoryHistory" { 121 | 122 | export default function createMemoryHistory(options?: HistoryModule.HistoryOptions): HistoryModule.History 123 | 124 | } 125 | 126 | 127 | declare module "history/lib/createLocation" { 128 | 129 | export default function createLocation(path?: HistoryModule.Path, state?: HistoryModule.LocationState, action?: HistoryModule.Action, key?: HistoryModule.LocationKey): HistoryModule.Location 130 | 131 | } 132 | 133 | 134 | declare module "history/lib/useBasename" { 135 | 136 | export default function useBasename(createHistory: HistoryModule.CreateHistory): HistoryModule.CreateHistory 137 | 138 | } 139 | 140 | 141 | declare module "history/lib/useBeforeUnload" { 142 | 143 | export default function useBeforeUnload(createHistory: HistoryModule.CreateHistory): HistoryModule.CreateHistory 144 | 145 | } 146 | 147 | 148 | declare module "history/lib/useQueries" { 149 | 150 | export default function useQueries(createHistory: HistoryModule.CreateHistory): HistoryModule.CreateHistory 151 | 152 | } 153 | 154 | 155 | declare module "history/lib/actions" { 156 | 157 | export const PUSH: string 158 | 159 | export const REPLACE: string 160 | 161 | export const POP: string 162 | 163 | export default { 164 | PUSH, 165 | REPLACE, 166 | POP 167 | } 168 | 169 | } 170 | 171 | 172 | declare module "history" { 173 | 174 | export { default as createHistory } from "history/lib/createBrowserHistory" 175 | 176 | export { default as createHashHistory } from "history/lib/createHashHistory" 177 | 178 | export { default as createMemoryHistory } from "history/lib/createMemoryHistory" 179 | 180 | export { default as createLocation } from "history/lib/createLocation" 181 | 182 | export { default as useBasename } from "history/lib/useBasename" 183 | 184 | export { default as useBeforeUnload } from "history/lib/useBeforeUnload" 185 | 186 | export { default as useQueries } from "history/lib/useQueries" 187 | 188 | import * as Actions from "history/lib/actions" 189 | 190 | export { Actions } 191 | 192 | } 193 | -------------------------------------------------------------------------------- /typings/react-router/react-router.d.ts: -------------------------------------------------------------------------------- 1 | // Type definitions for react-router v2.0.0-rc5 2 | // Project: https://github.com/rackt/react-router 3 | // Definitions by: Sergey Buturlakin , Yuichi Murata , Václav Ostrožlík 4 | // Definitions: https://github.com/borisyankov/DefinitelyTyped 5 | 6 | 7 | /// 8 | /// 9 | 10 | 11 | declare namespace ReactRouter { 12 | 13 | import React = __React 14 | 15 | import H = HistoryModule 16 | 17 | // types based on https://github.com/rackt/react-router/blob/master/docs/Glossary.md 18 | 19 | type Component = React.ReactType 20 | 21 | type EnterHook = (nextState: RouterState, replaceState: RedirectFunction, callback?: Function) => any 22 | 23 | type LeaveHook = () => any 24 | 25 | type Params = Object 26 | 27 | type ParseQueryString = (queryString: H.QueryString) => H.Query 28 | 29 | type RedirectFunction = (state: H.LocationState, pathname: H.Pathname | H.Path, query?: H.Query) => void 30 | 31 | type RouteComponent = Component 32 | 33 | // use the following interface in an app code to get access to route param values, history, location... 34 | // interface MyComponentProps extends ReactRouter.RouteComponentProps<{}, { id: number }> {} 35 | // somewhere in MyComponent 36 | // ... 37 | // let id = this.props.routeParams.id 38 | // ... 39 | // this.props.history. ... 40 | // ... 41 | interface RouteComponentProps { 42 | history?: History 43 | location?: H.Location 44 | params?: P 45 | route?: PlainRoute 46 | routeParams?: R 47 | routes?: PlainRoute[] 48 | children?: React.ReactElement 49 | } 50 | 51 | type RouteComponents = { [key: string]: RouteComponent } 52 | 53 | type RouteConfig = React.ReactNode | PlainRoute | PlainRoute[] 54 | 55 | type RouteHook = (nextLocation?: H.Location) => any 56 | 57 | type RoutePattern = string 58 | 59 | type StringifyQuery = (queryObject: H.Query) => H.QueryString 60 | 61 | type RouterListener = (error: Error, nextState: RouterState) => void 62 | 63 | interface RouterState { 64 | location: H.Location 65 | routes: PlainRoute[] 66 | params: Params 67 | components: RouteComponent[] 68 | } 69 | 70 | 71 | interface HistoryBase extends H.History { 72 | routes: PlainRoute[] 73 | parseQueryString?: ParseQueryString 74 | stringifyQuery?: StringifyQuery 75 | } 76 | 77 | type History = HistoryBase & H.HistoryQueries & HistoryRoutes 78 | const browserHistory: History; 79 | const hashHistory: History; 80 | 81 | /* components */ 82 | 83 | interface RouterProps extends React.Props { 84 | history?: H.History 85 | routes?: RouteConfig // alias for children 86 | createElement?: (component: RouteComponent, props: Object) => any 87 | onError?: (error: any) => any 88 | onUpdate?: () => any 89 | parseQueryString?: ParseQueryString 90 | stringifyQuery?: StringifyQuery 91 | } 92 | interface Router extends React.ComponentClass {} 93 | interface RouterElement extends React.ReactElement {} 94 | const Router: Router 95 | 96 | 97 | interface LinkProps extends React.HTMLAttributes, React.Props { 98 | activeStyle?: React.CSSProperties 99 | activeClassName?: string 100 | onlyActiveOnIndex?: boolean 101 | to: RoutePattern 102 | query?: H.Query 103 | state?: H.LocationState 104 | } 105 | interface Link extends React.ComponentClass {} 106 | interface LinkElement extends React.ReactElement {} 107 | const Link: Link 108 | 109 | 110 | const IndexLink: Link 111 | 112 | 113 | interface RouterContextProps extends React.Props { 114 | history?: H.History 115 | router: Router 116 | createElement: (component: RouteComponent, props: Object) => any 117 | location: H.Location 118 | routes: RouteConfig 119 | params: Params 120 | components?: RouteComponent[] 121 | } 122 | interface RouterContext extends React.ComponentClass {} 123 | interface RouterContextElement extends React.ReactElement { 124 | history?: H.History 125 | location: H.Location 126 | router?: Router 127 | } 128 | const RouterContext: RouterContext 129 | 130 | 131 | /* components (configuration) */ 132 | 133 | interface RouteProps extends React.Props { 134 | path?: RoutePattern 135 | component?: RouteComponent 136 | components?: RouteComponents 137 | getComponent?: (location: H.Location, cb: (error: any, component?: RouteComponent) => void) => void 138 | getComponents?: (location: H.Location, cb: (error: any, components?: RouteComponents) => void) => void 139 | onEnter?: EnterHook 140 | onLeave?: LeaveHook 141 | getIndexRoute?: (location: H.Location, cb: (error: any, indexRoute: RouteConfig) => void) => void 142 | getChildRoutes?: (location: H.Location, cb: (error: any, childRoutes: RouteConfig) => void) => void 143 | } 144 | interface Route extends React.ComponentClass {} 145 | interface RouteElement extends React.ReactElement {} 146 | const Route: Route 147 | 148 | 149 | interface PlainRoute { 150 | path?: RoutePattern 151 | component?: RouteComponent 152 | components?: RouteComponents 153 | getComponent?: (location: H.Location, cb: (error: any, component?: RouteComponent) => void) => void 154 | getComponents?: (location: H.Location, cb: (error: any, components?: RouteComponents) => void) => void 155 | onEnter?: EnterHook 156 | onLeave?: LeaveHook 157 | indexRoute?: PlainRoute 158 | getIndexRoute?: (location: H.Location, cb: (error: any, indexRoute: RouteConfig) => void) => void 159 | childRoutes?: PlainRoute[] 160 | getChildRoutes?: (location: H.Location, cb: (error: any, childRoutes: RouteConfig) => void) => void 161 | } 162 | 163 | 164 | interface RedirectProps extends React.Props { 165 | path?: RoutePattern 166 | from?: RoutePattern // alias for path 167 | to: RoutePattern 168 | query?: H.Query 169 | state?: H.LocationState 170 | } 171 | interface Redirect extends React.ComponentClass {} 172 | interface RedirectElement extends React.ReactElement {} 173 | const Redirect: Redirect 174 | 175 | 176 | interface IndexRouteProps extends React.Props { 177 | component?: RouteComponent 178 | components?: RouteComponents 179 | getComponent?: (location: H.Location, cb: (error: any, component?: RouteComponent) => void) => void 180 | getComponents?: (location: H.Location, cb: (error: any, components?: RouteComponents) => void) => void 181 | onEnter?: EnterHook 182 | onLeave?: LeaveHook 183 | } 184 | interface IndexRoute extends React.ComponentClass {} 185 | interface IndexRouteElement extends React.ReactElement {} 186 | const IndexRoute: IndexRoute 187 | 188 | 189 | interface IndexRedirectProps extends React.Props { 190 | to: RoutePattern 191 | query?: H.Query 192 | state?: H.LocationState 193 | } 194 | interface IndexRedirect extends React.ComponentClass {} 195 | interface IndexRedirectElement extends React.ReactElement {} 196 | const IndexRedirect: IndexRedirect 197 | 198 | 199 | /* mixins */ 200 | 201 | interface HistoryMixin { 202 | history: History 203 | } 204 | const History: React.Mixin 205 | 206 | 207 | interface LifecycleMixin { 208 | routerWillLeave(nextLocation: H.Location): string | boolean 209 | } 210 | const Lifecycle: React.Mixin 211 | 212 | 213 | const RouteContext: React.Mixin 214 | 215 | 216 | /* utils */ 217 | 218 | interface HistoryRoutes { 219 | listen(listener: RouterListener): Function 220 | listenBeforeLeavingRoute(route: PlainRoute, hook: RouteHook): void 221 | match(location: H.Location, callback: (error: any, nextState: RouterState, nextLocation: H.Location) => void): void 222 | isActive(pathname: H.Pathname, query?: H.Query, indexOnly?: boolean): boolean 223 | } 224 | 225 | function useRoutes(createHistory: HistoryModule.CreateHistory): HistoryModule.CreateHistory 226 | 227 | 228 | function createRoutes(routes: RouteConfig): PlainRoute[] 229 | 230 | 231 | interface MatchArgs { 232 | routes?: RouteConfig 233 | history?: H.History 234 | location?: H.Location 235 | parseQueryString?: ParseQueryString 236 | stringifyQuery?: StringifyQuery 237 | } 238 | interface MatchState extends RouterState { 239 | history: History 240 | } 241 | function match(args: MatchArgs, cb: (error: any, nextLocation: H.Location, nextState: MatchState) => void): void 242 | 243 | } 244 | 245 | 246 | declare module "react-router/lib/Router" { 247 | 248 | export default ReactRouter.Router 249 | 250 | } 251 | 252 | 253 | declare module "react-router/lib/Link" { 254 | 255 | export default ReactRouter.Link 256 | 257 | } 258 | 259 | 260 | declare module "react-router/lib/IndexLink" { 261 | 262 | export default ReactRouter.IndexLink 263 | 264 | } 265 | 266 | 267 | declare module "react-router/lib/IndexRedirect" { 268 | 269 | export default ReactRouter.IndexRedirect 270 | 271 | } 272 | 273 | 274 | declare module "react-router/lib/IndexRoute" { 275 | 276 | export default ReactRouter.IndexRoute 277 | 278 | } 279 | 280 | 281 | declare module "react-router/lib/Redirect" { 282 | 283 | export default ReactRouter.Redirect 284 | 285 | } 286 | 287 | 288 | declare module "react-router/lib/Route" { 289 | 290 | export default ReactRouter.Route 291 | 292 | } 293 | 294 | 295 | declare module "react-router/lib/History" { 296 | 297 | export default ReactRouter.History 298 | 299 | } 300 | 301 | 302 | declare module "react-router/lib/Lifecycle" { 303 | 304 | export default ReactRouter.Lifecycle 305 | 306 | } 307 | 308 | 309 | declare module "react-router/lib/RouteContext" { 310 | 311 | export default ReactRouter.RouteContext 312 | 313 | } 314 | 315 | 316 | declare module "react-router/lib/useRoutes" { 317 | 318 | export default ReactRouter.useRoutes 319 | 320 | } 321 | 322 | declare module "react-router/lib/PatternUtils" { 323 | 324 | export function formatPattern(pattern: string, params: {}): string; 325 | 326 | } 327 | 328 | declare module "react-router/lib/RouteUtils" { 329 | 330 | type E = __React.ReactElement 331 | 332 | export function isReactChildren(object: E | E[]): boolean 333 | 334 | export function createRouteFromReactElement(element: E): ReactRouter.PlainRoute 335 | 336 | export function createRoutesFromReactChildren(children: E | E[], parentRoute: ReactRouter.PlainRoute): ReactRouter.PlainRoute[] 337 | 338 | export import createRoutes = ReactRouter.createRoutes 339 | 340 | } 341 | 342 | 343 | declare module "react-router/lib/RouterContext" { 344 | 345 | export default ReactRouter.RouterContext 346 | 347 | } 348 | 349 | 350 | declare module "react-router/lib/PropTypes" { 351 | 352 | import React = __React 353 | 354 | export function falsy(props: any, propName: string, componentName: string): Error; 355 | 356 | export const history: React.Requireable 357 | 358 | export const location: React.Requireable 359 | 360 | export const component: React.Requireable 361 | 362 | export const components: React.Requireable 363 | 364 | export const route: React.Requireable 365 | 366 | export const routes: React.Requireable 367 | 368 | export default { 369 | falsy, 370 | history, 371 | location, 372 | component, 373 | components, 374 | route 375 | } 376 | 377 | } 378 | 379 | declare module "react-router/lib/browserHistory" { 380 | export default ReactRouter.browserHistory; 381 | } 382 | 383 | declare module "react-router/lib/hashHistory" { 384 | export default ReactRouter.hashHistory; 385 | } 386 | 387 | declare module "react-router/lib/match" { 388 | 389 | export default ReactRouter.match 390 | 391 | } 392 | 393 | 394 | declare module "react-router" { 395 | 396 | import Router from "react-router/lib/Router" 397 | 398 | import Link from "react-router/lib/Link" 399 | 400 | import IndexLink from "react-router/lib/IndexLink" 401 | 402 | import IndexRedirect from "react-router/lib/IndexRedirect" 403 | 404 | import IndexRoute from "react-router/lib/IndexRoute" 405 | 406 | import Redirect from "react-router/lib/Redirect" 407 | 408 | import Route from "react-router/lib/Route" 409 | 410 | import History from "react-router/lib/History" 411 | 412 | import Lifecycle from "react-router/lib/Lifecycle" 413 | 414 | import RouteContext from "react-router/lib/RouteContext" 415 | 416 | import browserHistory from "react-router/lib/browserHistory" 417 | 418 | import hashHistory from "react-router/lib/hashHistory" 419 | 420 | import useRoutes from "react-router/lib/useRoutes" 421 | 422 | import { createRoutes } from "react-router/lib/RouteUtils" 423 | 424 | import { formatPattern } from "react-router/lib/PatternUtils" 425 | 426 | import RouterContext from "react-router/lib/RouterContext" 427 | 428 | import PropTypes from "react-router/lib/PropTypes" 429 | 430 | import match from "react-router/lib/match" 431 | 432 | // PlainRoute is defined in the API documented at: 433 | // https://github.com/rackt/react-router/blob/master/docs/API.md 434 | // but not included in any of the .../lib modules above. 435 | export type PlainRoute = ReactRouter.PlainRoute 436 | 437 | // The following definitions are also very useful to export 438 | // because by using these types lots of potential type errors 439 | // can be exposed: 440 | export type EnterHook = ReactRouter.EnterHook 441 | export type LeaveHook = ReactRouter.LeaveHook 442 | export type ParseQueryString = ReactRouter.ParseQueryString 443 | export type RedirectFunction = ReactRouter.RedirectFunction 444 | export type RouteComponentProps = ReactRouter.RouteComponentProps; 445 | export type RouteHook = ReactRouter.RouteHook 446 | export type StringifyQuery = ReactRouter.StringifyQuery 447 | export type RouterListener = ReactRouter.RouterListener 448 | export type RouterState = ReactRouter.RouterState 449 | export type HistoryBase = ReactRouter.HistoryBase 450 | 451 | export { 452 | Router, 453 | Link, 454 | IndexLink, 455 | IndexRedirect, 456 | IndexRoute, 457 | Redirect, 458 | Route, 459 | History, 460 | browserHistory, 461 | hashHistory, 462 | Lifecycle, 463 | RouteContext, 464 | useRoutes, 465 | createRoutes, 466 | formatPattern, 467 | RouterContext, 468 | PropTypes, 469 | match 470 | } 471 | 472 | export default Router 473 | 474 | } 475 | -------------------------------------------------------------------------------- /typings/react/react-dom.d.ts: -------------------------------------------------------------------------------- 1 | // Type definitions for React v0.14 (react-dom) 2 | // Project: http://facebook.github.io/react/ 3 | // Definitions by: Asana , AssureSign , Microsoft 4 | // Definitions: https://github.com/borisyankov/DefinitelyTyped 5 | 6 | /// 7 | 8 | declare namespace __React { 9 | namespace __DOM { 10 | function findDOMNode(instance: ReactInstance): E; 11 | function findDOMNode(instance: ReactInstance): Element; 12 | 13 | function render

    ( 14 | element: DOMElement

    , 15 | container: Element, 16 | callback?: (element: Element) => any): Element; 17 | function render( 18 | element: ClassicElement

    , 19 | container: Element, 20 | callback?: (component: ClassicComponent) => any): ClassicComponent; 21 | function render( 22 | element: ReactElement

    , 23 | container: Element, 24 | callback?: (component: Component) => any): Component; 25 | 26 | function unmountComponentAtNode(container: Element): boolean; 27 | 28 | var version: string; 29 | 30 | function unstable_batchedUpdates(callback: (a: A, b: B) => any, a: A, b: B): void; 31 | function unstable_batchedUpdates(callback: (a: A) => any, a: A): void; 32 | function unstable_batchedUpdates(callback: () => any): void; 33 | 34 | function unstable_renderSubtreeIntoContainer

    ( 35 | parentComponent: Component, 36 | nextElement: DOMElement

    , 37 | container: Element, 38 | callback?: (element: Element) => any): Element; 39 | function unstable_renderSubtreeIntoContainer( 40 | parentComponent: Component, 41 | nextElement: ClassicElement

    , 42 | container: Element, 43 | callback?: (component: ClassicComponent) => any): ClassicComponent; 44 | function unstable_renderSubtreeIntoContainer( 45 | parentComponent: Component, 46 | nextElement: ReactElement

    , 47 | container: Element, 48 | callback?: (component: Component) => any): Component; 49 | } 50 | 51 | namespace __DOMServer { 52 | function renderToString(element: ReactElement): string; 53 | function renderToStaticMarkup(element: ReactElement): string; 54 | var version: string; 55 | } 56 | } 57 | 58 | declare module "react-dom" { 59 | import DOM = __React.__DOM; 60 | export = DOM; 61 | } 62 | 63 | declare module "react-dom/server" { 64 | import DOMServer = __React.__DOMServer; 65 | export = DOMServer; 66 | } 67 | -------------------------------------------------------------------------------- /typings/react/react.d.ts: -------------------------------------------------------------------------------- 1 | // Type definitions for React v0.14 2 | // Project: http://facebook.github.io/react/ 3 | // Definitions by: Asana , AssureSign , Microsoft 4 | // Definitions: https://github.com/borisyankov/DefinitelyTyped 5 | 6 | declare namespace __React { 7 | 8 | // 9 | // React Elements 10 | // ---------------------------------------------------------------------- 11 | 12 | type ReactType = string | ComponentClass | StatelessComponent; 13 | 14 | interface ReactElement

    > { 15 | type: string | ComponentClass

    | StatelessComponent

    ; 16 | props: P; 17 | key: string | number; 18 | ref: string | ((component: Component | Element) => any); 19 | } 20 | 21 | interface ClassicElement

    extends ReactElement

    { 22 | type: ClassicComponentClass

    ; 23 | ref: string | ((component: ClassicComponent) => any); 24 | } 25 | 26 | interface DOMElement

    > extends ReactElement

    { 27 | type: string; 28 | ref: string | ((element: Element) => any); 29 | } 30 | 31 | interface ReactHTMLElement extends DOMElement> { 32 | ref: string | ((element: HTMLElement) => any); 33 | } 34 | 35 | interface ReactSVGElement extends DOMElement { 36 | ref: string | ((element: SVGElement) => any); 37 | } 38 | 39 | // 40 | // Factories 41 | // ---------------------------------------------------------------------- 42 | 43 | interface Factory

    { 44 | (props?: P, ...children: ReactNode[]): ReactElement

    ; 45 | } 46 | 47 | interface ClassicFactory

    extends Factory

    { 48 | (props?: P, ...children: ReactNode[]): ClassicElement

    ; 49 | } 50 | 51 | interface DOMFactory

    > extends Factory

    { 52 | (props?: P, ...children: ReactNode[]): DOMElement

    ; 53 | } 54 | 55 | type HTMLFactory = DOMFactory>; 56 | type SVGFactory = DOMFactory; 57 | 58 | // 59 | // React Nodes 60 | // http://facebook.github.io/react/docs/glossary.html 61 | // ---------------------------------------------------------------------- 62 | 63 | type ReactText = string | number; 64 | type ReactChild = ReactElement | ReactText; 65 | 66 | // Should be Array but type aliases cannot be recursive 67 | type ReactFragment = {} | Array; 68 | type ReactNode = ReactChild | ReactFragment | boolean; 69 | 70 | // 71 | // Top Level API 72 | // ---------------------------------------------------------------------- 73 | 74 | function createClass(spec: ComponentSpec): ClassicComponentClass

    ; 75 | 76 | function createFactory

    (type: string): DOMFactory

    ; 77 | function createFactory

    (type: ClassicComponentClass

    ): ClassicFactory

    ; 78 | function createFactory

    (type: ComponentClass

    | StatelessComponent

    ): Factory

    ; 79 | 80 | function createElement

    ( 81 | type: string, 82 | props?: P, 83 | ...children: ReactNode[]): DOMElement

    ; 84 | function createElement

    ( 85 | type: ClassicComponentClass

    , 86 | props?: P, 87 | ...children: ReactNode[]): ClassicElement

    ; 88 | function createElement

    ( 89 | type: ComponentClass

    | StatelessComponent

    , 90 | props?: P, 91 | ...children: ReactNode[]): ReactElement

    ; 92 | 93 | function cloneElement

    ( 94 | element: DOMElement

    , 95 | props?: P, 96 | ...children: ReactNode[]): DOMElement

    ; 97 | function cloneElement

    ( 98 | element: ClassicElement

    , 99 | props?: P, 100 | ...children: ReactNode[]): ClassicElement

    ; 101 | function cloneElement

    ( 102 | element: ReactElement

    , 103 | props?: P, 104 | ...children: ReactNode[]): ReactElement

    ; 105 | 106 | function isValidElement(object: {}): boolean; 107 | 108 | var DOM: ReactDOM; 109 | var PropTypes: ReactPropTypes; 110 | var Children: ReactChildren; 111 | 112 | // 113 | // Component API 114 | // ---------------------------------------------------------------------- 115 | 116 | type ReactInstance = Component | Element; 117 | 118 | // Base component for plain JS classes 119 | class Component implements ComponentLifecycle { 120 | constructor(props?: P, context?: any); 121 | setState(f: (prevState: S, props: P) => S, callback?: () => any): void; 122 | setState(state: S, callback?: () => any): void; 123 | forceUpdate(callBack?: () => any): void; 124 | render(): JSX.Element; 125 | props: P; 126 | state: S; 127 | context: {}; 128 | refs: { 129 | [key: string]: ReactInstance 130 | }; 131 | } 132 | 133 | interface ClassicComponent extends Component { 134 | replaceState(nextState: S, callback?: () => any): void; 135 | isMounted(): boolean; 136 | getInitialState?(): S; 137 | } 138 | 139 | interface ChildContextProvider { 140 | getChildContext(): CC; 141 | } 142 | 143 | // 144 | // Class Interfaces 145 | // ---------------------------------------------------------------------- 146 | 147 | interface StatelessComponent

    { 148 | (props?: P, context?: any): ReactElement; 149 | propTypes?: ValidationMap

    ; 150 | contextTypes?: ValidationMap; 151 | defaultProps?: P; 152 | displayName?: string; 153 | } 154 | 155 | interface ComponentClass

    { 156 | new(props?: P, context?: any): Component; 157 | propTypes?: ValidationMap

    ; 158 | contextTypes?: ValidationMap; 159 | childContextTypes?: ValidationMap; 160 | defaultProps?: P; 161 | } 162 | 163 | interface ClassicComponentClass

    extends ComponentClass

    { 164 | new(props?: P, context?: any): ClassicComponent; 165 | getDefaultProps?(): P; 166 | displayName?: string; 167 | } 168 | 169 | // 170 | // Component Specs and Lifecycle 171 | // ---------------------------------------------------------------------- 172 | 173 | interface ComponentLifecycle { 174 | componentWillMount?(): void; 175 | componentDidMount?(): void; 176 | componentWillReceiveProps?(nextProps: P, nextContext: any): void; 177 | shouldComponentUpdate?(nextProps: P, nextState: S, nextContext: any): boolean; 178 | componentWillUpdate?(nextProps: P, nextState: S, nextContext: any): void; 179 | componentDidUpdate?(prevProps: P, prevState: S, prevContext: any): void; 180 | componentWillUnmount?(): void; 181 | } 182 | 183 | interface Mixin extends ComponentLifecycle { 184 | mixins?: Mixin; 185 | statics?: { 186 | [key: string]: any; 187 | }; 188 | 189 | displayName?: string; 190 | propTypes?: ValidationMap; 191 | contextTypes?: ValidationMap; 192 | childContextTypes?: ValidationMap; 193 | 194 | getDefaultProps?(): P; 195 | getInitialState?(): S; 196 | } 197 | 198 | interface ComponentSpec extends Mixin { 199 | render(): ReactElement; 200 | 201 | [propertyName: string]: any; 202 | } 203 | 204 | // 205 | // Event System 206 | // ---------------------------------------------------------------------- 207 | 208 | interface SyntheticEvent { 209 | bubbles: boolean; 210 | cancelable: boolean; 211 | currentTarget: EventTarget; 212 | defaultPrevented: boolean; 213 | eventPhase: number; 214 | isTrusted: boolean; 215 | nativeEvent: Event; 216 | preventDefault(): void; 217 | stopPropagation(): void; 218 | target: EventTarget; 219 | timeStamp: Date; 220 | type: string; 221 | } 222 | 223 | interface ClipboardEvent extends SyntheticEvent { 224 | clipboardData: DataTransfer; 225 | } 226 | 227 | interface CompositionEvent extends SyntheticEvent { 228 | data: string; 229 | } 230 | 231 | interface DragEvent extends SyntheticEvent { 232 | dataTransfer: DataTransfer; 233 | } 234 | 235 | interface FocusEvent extends SyntheticEvent { 236 | relatedTarget: EventTarget; 237 | } 238 | 239 | interface FormEvent extends SyntheticEvent { 240 | } 241 | 242 | interface KeyboardEvent extends SyntheticEvent { 243 | altKey: boolean; 244 | charCode: number; 245 | ctrlKey: boolean; 246 | getModifierState(key: string): boolean; 247 | key: string; 248 | keyCode: number; 249 | locale: string; 250 | location: number; 251 | metaKey: boolean; 252 | repeat: boolean; 253 | shiftKey: boolean; 254 | which: number; 255 | } 256 | 257 | interface MouseEvent extends SyntheticEvent { 258 | altKey: boolean; 259 | button: number; 260 | buttons: number; 261 | clientX: number; 262 | clientY: number; 263 | ctrlKey: boolean; 264 | getModifierState(key: string): boolean; 265 | metaKey: boolean; 266 | pageX: number; 267 | pageY: number; 268 | relatedTarget: EventTarget; 269 | screenX: number; 270 | screenY: number; 271 | shiftKey: boolean; 272 | } 273 | 274 | interface TouchEvent extends SyntheticEvent { 275 | altKey: boolean; 276 | changedTouches: TouchList; 277 | ctrlKey: boolean; 278 | getModifierState(key: string): boolean; 279 | metaKey: boolean; 280 | shiftKey: boolean; 281 | targetTouches: TouchList; 282 | touches: TouchList; 283 | } 284 | 285 | interface UIEvent extends SyntheticEvent { 286 | detail: number; 287 | view: AbstractView; 288 | } 289 | 290 | interface WheelEvent extends SyntheticEvent { 291 | deltaMode: number; 292 | deltaX: number; 293 | deltaY: number; 294 | deltaZ: number; 295 | } 296 | 297 | // 298 | // Event Handler Types 299 | // ---------------------------------------------------------------------- 300 | 301 | interface EventHandler { 302 | (event: E): void; 303 | } 304 | 305 | type ReactEventHandler = EventHandler; 306 | 307 | type ClipboardEventHandler = EventHandler; 308 | type CompositionEventHandler = EventHandler; 309 | type DragEventHandler = EventHandler; 310 | type FocusEventHandler = EventHandler; 311 | type FormEventHandler = EventHandler; 312 | type KeyboardEventHandler = EventHandler; 313 | type MouseEventHandler = EventHandler; 314 | type TouchEventHandler = EventHandler; 315 | type UIEventHandler = EventHandler; 316 | type WheelEventHandler = EventHandler; 317 | 318 | // 319 | // Props / DOM Attributes 320 | // ---------------------------------------------------------------------- 321 | 322 | interface Props { 323 | children?: ReactNode; 324 | key?: string | number; 325 | ref?: string | ((component: T) => any); 326 | } 327 | 328 | interface HTMLProps extends HTMLAttributes, Props { 329 | } 330 | 331 | interface SVGProps extends SVGAttributes, Props { 332 | } 333 | 334 | interface DOMAttributes { 335 | dangerouslySetInnerHTML?: { 336 | __html: string; 337 | }; 338 | 339 | // Clipboard Events 340 | onCopy?: ClipboardEventHandler; 341 | onCut?: ClipboardEventHandler; 342 | onPaste?: ClipboardEventHandler; 343 | 344 | // Composition Events 345 | onCompositionEnd?: CompositionEventHandler; 346 | onCompositionStart?: CompositionEventHandler; 347 | onCompositionUpdate?: CompositionEventHandler; 348 | 349 | // Focus Events 350 | onFocus?: FocusEventHandler; 351 | onBlur?: FocusEventHandler; 352 | 353 | // Form Events 354 | onChange?: FormEventHandler; 355 | onInput?: FormEventHandler; 356 | onSubmit?: FormEventHandler; 357 | 358 | // Image Events 359 | onLoad?: ReactEventHandler; 360 | onError?: ReactEventHandler; // also a Media Event 361 | 362 | // Keyboard Events 363 | onKeyDown?: KeyboardEventHandler; 364 | onKeyPress?: KeyboardEventHandler; 365 | onKeyUp?: KeyboardEventHandler; 366 | 367 | // Media Events 368 | onAbort?: ReactEventHandler; 369 | onCanPlay?: ReactEventHandler; 370 | onCanPlayThrough?: ReactEventHandler; 371 | onDurationChange?: ReactEventHandler; 372 | onEmptied?: ReactEventHandler; 373 | onEncrypted?: ReactEventHandler; 374 | onEnded?: ReactEventHandler; 375 | onLoadedData?: ReactEventHandler; 376 | onLoadedMetadata?: ReactEventHandler; 377 | onLoadStart?: ReactEventHandler; 378 | onPause?: ReactEventHandler; 379 | onPlay?: ReactEventHandler; 380 | onPlaying?: ReactEventHandler; 381 | onProgress?: ReactEventHandler; 382 | onRateChange?: ReactEventHandler; 383 | onSeeked?: ReactEventHandler; 384 | onSeeking?: ReactEventHandler; 385 | onStalled?: ReactEventHandler; 386 | onSuspend?: ReactEventHandler; 387 | onTimeUpdate?: ReactEventHandler; 388 | onVolumeChange?: ReactEventHandler; 389 | onWaiting?: ReactEventHandler; 390 | 391 | // MouseEvents 392 | onClick?: MouseEventHandler; 393 | onContextMenu?: MouseEventHandler; 394 | onDoubleClick?: MouseEventHandler; 395 | onDrag?: DragEventHandler; 396 | onDragEnd?: DragEventHandler; 397 | onDragEnter?: DragEventHandler; 398 | onDragExit?: DragEventHandler; 399 | onDragLeave?: DragEventHandler; 400 | onDragOver?: DragEventHandler; 401 | onDragStart?: DragEventHandler; 402 | onDrop?: DragEventHandler; 403 | onMouseDown?: MouseEventHandler; 404 | onMouseEnter?: MouseEventHandler; 405 | onMouseLeave?: MouseEventHandler; 406 | onMouseMove?: MouseEventHandler; 407 | onMouseOut?: MouseEventHandler; 408 | onMouseOver?: MouseEventHandler; 409 | onMouseUp?: MouseEventHandler; 410 | 411 | // Selection Events 412 | onSelect?: ReactEventHandler; 413 | 414 | // Touch Events 415 | onTouchCancel?: TouchEventHandler; 416 | onTouchEnd?: TouchEventHandler; 417 | onTouchMove?: TouchEventHandler; 418 | onTouchStart?: TouchEventHandler; 419 | 420 | // UI Events 421 | onScroll?: UIEventHandler; 422 | 423 | // Wheel Events 424 | onWheel?: WheelEventHandler; 425 | } 426 | 427 | // This interface is not complete. Only properties accepting 428 | // unitless numbers are listed here (see CSSProperty.js in React) 429 | interface CSSProperties { 430 | boxFlex?: number; 431 | boxFlexGroup?: number; 432 | columnCount?: number; 433 | flex?: number | string; 434 | flexGrow?: number; 435 | flexShrink?: number; 436 | fontWeight?: number | string; 437 | lineClamp?: number; 438 | lineHeight?: number | string; 439 | opacity?: number; 440 | order?: number; 441 | orphans?: number; 442 | widows?: number; 443 | zIndex?: number; 444 | zoom?: number; 445 | 446 | fontSize?: number | string; 447 | 448 | // SVG-related properties 449 | fillOpacity?: number; 450 | strokeOpacity?: number; 451 | strokeWidth?: number; 452 | 453 | // Remaining properties auto-extracted from http://docs.webplatform.org. 454 | // License: http://docs.webplatform.org/wiki/Template:CC-by-3.0 455 | /** 456 | * Aligns a flex container's lines within the flex container when there is extra space in the cross-axis, similar to how justify-content aligns individual items within the main-axis. 457 | */ 458 | alignContent?: any; 459 | 460 | /** 461 | * Sets the default alignment in the cross axis for all of the flex container's items, including anonymous flex items, similarly to how justify-content aligns items along the main axis. 462 | */ 463 | alignItems?: any; 464 | 465 | /** 466 | * Allows the default alignment to be overridden for individual flex items. 467 | */ 468 | alignSelf?: any; 469 | 470 | /** 471 | * This property allows precise alignment of elements, such as graphics, that do not have a baseline-table or lack the desired baseline in their baseline-table. With the alignment-adjust property, the position of the baseline identified by the alignment-baseline can be explicitly determined. It also determines precisely the alignment point for each glyph within a textual element. 472 | */ 473 | alignmentAdjust?: any; 474 | 475 | alignmentBaseline?: any; 476 | 477 | /** 478 | * Defines a length of time to elapse before an animation starts, allowing an animation to begin execution some time after it is applied. 479 | */ 480 | animationDelay?: any; 481 | 482 | /** 483 | * Defines whether an animation should run in reverse on some or all cycles. 484 | */ 485 | animationDirection?: any; 486 | 487 | /** 488 | * Specifies how many times an animation cycle should play. 489 | */ 490 | animationIterationCount?: any; 491 | 492 | /** 493 | * Defines the list of animations that apply to the element. 494 | */ 495 | animationName?: any; 496 | 497 | /** 498 | * Defines whether an animation is running or paused. 499 | */ 500 | animationPlayState?: any; 501 | 502 | /** 503 | * Allows changing the style of any element to platform-based interface elements or vice versa. 504 | */ 505 | appearance?: any; 506 | 507 | /** 508 | * Determines whether or not the “back” side of a transformed element is visible when facing the viewer. 509 | */ 510 | backfaceVisibility?: any; 511 | 512 | /** 513 | * This property describes how the element's background images should blend with each other and the element's background color. 514 | * The value is a list of blend modes that corresponds to each background image. Each element in the list will apply to the corresponding element of background-image. If a property doesn’t have enough comma-separated values to match the number of layers, the UA must calculate its used value by repeating the list of values until there are enough. 515 | */ 516 | backgroundBlendMode?: any; 517 | 518 | backgroundColor?: any; 519 | 520 | backgroundComposite?: any; 521 | 522 | /** 523 | * Applies one or more background images to an element. These can be any valid CSS image, including url() paths to image files or CSS gradients. 524 | */ 525 | backgroundImage?: any; 526 | 527 | /** 528 | * Specifies what the background-position property is relative to. 529 | */ 530 | backgroundOrigin?: any; 531 | 532 | /** 533 | * Sets the horizontal position of a background image. 534 | */ 535 | backgroundPositionX?: any; 536 | 537 | /** 538 | * Background-repeat defines if and how background images will be repeated after they have been sized and positioned 539 | */ 540 | backgroundRepeat?: any; 541 | 542 | /** 543 | * Obsolete - spec retired, not implemented. 544 | */ 545 | baselineShift?: any; 546 | 547 | /** 548 | * Non standard. Sets or retrieves the location of the Dynamic HTML (DHTML) behavior. 549 | */ 550 | behavior?: any; 551 | 552 | /** 553 | * Shorthand property that defines the different properties of all four sides of an element's border in a single declaration. It can be used to set border-width, border-style and border-color, or a subset of these. 554 | */ 555 | border?: any; 556 | 557 | /** 558 | * Defines the shape of the border of the bottom-left corner. 559 | */ 560 | borderBottomLeftRadius?: any; 561 | 562 | /** 563 | * Defines the shape of the border of the bottom-right corner. 564 | */ 565 | borderBottomRightRadius?: any; 566 | 567 | /** 568 | * Sets the width of an element's bottom border. To set all four borders, use the border-width shorthand property which sets the values simultaneously for border-top-width, border-right-width, border-bottom-width, and border-left-width. 569 | */ 570 | borderBottomWidth?: any; 571 | 572 | /** 573 | * Border-collapse can be used for collapsing the borders between table cells 574 | */ 575 | borderCollapse?: any; 576 | 577 | /** 578 | * The CSS border-color property sets the color of an element's four borders. This property can have from one to four values, made up of the elementary properties: • border-top-color 579 | * • border-right-color 580 | * • border-bottom-color 581 | * • border-left-color The default color is the currentColor of each of these values. 582 | * If you provide one value, it sets the color for the element. Two values set the horizontal and vertical values, respectively. Providing three values sets the top, vertical, and bottom values, in that order. Four values set all for sides: top, right, bottom, and left, in that order. 583 | */ 584 | borderColor?: any; 585 | 586 | /** 587 | * Specifies different corner clipping effects, such as scoop (inner curves), bevel (straight cuts) or notch (cut-off rectangles). Works along with border-radius to specify the size of each corner effect. 588 | */ 589 | borderCornerShape?: any; 590 | 591 | /** 592 | * The property border-image-source is used to set the image to be used instead of the border style. If this is set to none the border-style is used instead. 593 | */ 594 | borderImageSource?: any; 595 | 596 | /** 597 | * The border-image-width CSS property defines the offset to use for dividing the border image in nine parts, the top-left corner, central top edge, top-right-corner, central right edge, bottom-right corner, central bottom edge, bottom-left corner, and central right edge. They represent inward distance from the top, right, bottom, and left edges. 598 | */ 599 | borderImageWidth?: any; 600 | 601 | /** 602 | * Shorthand property that defines the border-width, border-style and border-color of an element's left border in a single declaration. Note that you can use the corresponding longhand properties to set specific individual properties of the left border — border-left-width, border-left-style and border-left-color. 603 | */ 604 | borderLeft?: any; 605 | 606 | /** 607 | * The CSS border-left-color property sets the color of an element's left border. This page explains the border-left-color value, but often you will find it more convenient to fix the border's left color as part of a shorthand set, either border-left or border-color. 608 | * Colors can be defined several ways. For more information, see Usage. 609 | */ 610 | borderLeftColor?: any; 611 | 612 | /** 613 | * Sets the style of an element's left border. To set all four borders, use the shorthand property, border-style. Otherwise, you can set the borders individually with border-top-style, border-right-style, border-bottom-style, border-left-style. 614 | */ 615 | borderLeftStyle?: any; 616 | 617 | /** 618 | * Sets the width of an element's left border. To set all four borders, use the border-width shorthand property which sets the values simultaneously for border-top-width, border-right-width, border-bottom-width, and border-left-width. 619 | */ 620 | borderLeftWidth?: any; 621 | 622 | /** 623 | * Shorthand property that defines the border-width, border-style and border-color of an element's right border in a single declaration. Note that you can use the corresponding longhand properties to set specific individual properties of the right border — border-right-width, border-right-style and border-right-color. 624 | */ 625 | borderRight?: any; 626 | 627 | /** 628 | * Sets the color of an element's right border. This page explains the border-right-color value, but often you will find it more convenient to fix the border's right color as part of a shorthand set, either border-right or border-color. 629 | * Colors can be defined several ways. For more information, see Usage. 630 | */ 631 | borderRightColor?: any; 632 | 633 | /** 634 | * Sets the style of an element's right border. To set all four borders, use the shorthand property, border-style. Otherwise, you can set the borders individually with border-top-style, border-right-style, border-bottom-style, border-left-style. 635 | */ 636 | borderRightStyle?: any; 637 | 638 | /** 639 | * Sets the width of an element's right border. To set all four borders, use the border-width shorthand property which sets the values simultaneously for border-top-width, border-right-width, border-bottom-width, and border-left-width. 640 | */ 641 | borderRightWidth?: any; 642 | 643 | /** 644 | * Specifies the distance between the borders of adjacent cells. 645 | */ 646 | borderSpacing?: any; 647 | 648 | /** 649 | * Sets the style of an element's four borders. This property can have from one to four values. With only one value, the value will be applied to all four borders; otherwise, this works as a shorthand property for each of border-top-style, border-right-style, border-bottom-style, border-left-style, where each border style may be assigned a separate value. 650 | */ 651 | borderStyle?: any; 652 | 653 | /** 654 | * Shorthand property that defines the border-width, border-style and border-color of an element's top border in a single declaration. Note that you can use the corresponding longhand properties to set specific individual properties of the top border — border-top-width, border-top-style and border-top-color. 655 | */ 656 | borderTop?: any; 657 | 658 | /** 659 | * Sets the color of an element's top border. This page explains the border-top-color value, but often you will find it more convenient to fix the border's top color as part of a shorthand set, either border-top or border-color. 660 | * Colors can be defined several ways. For more information, see Usage. 661 | */ 662 | borderTopColor?: any; 663 | 664 | /** 665 | * Sets the rounding of the top-left corner of the element. 666 | */ 667 | borderTopLeftRadius?: any; 668 | 669 | /** 670 | * Sets the rounding of the top-right corner of the element. 671 | */ 672 | borderTopRightRadius?: any; 673 | 674 | /** 675 | * Sets the style of an element's top border. To set all four borders, use the shorthand property, border-style. Otherwise, you can set the borders individually with border-top-style, border-right-style, border-bottom-style, border-left-style. 676 | */ 677 | borderTopStyle?: any; 678 | 679 | /** 680 | * Sets the width of an element's top border. To set all four borders, use the border-width shorthand property which sets the values simultaneously for border-top-width, border-right-width, border-bottom-width, and border-left-width. 681 | */ 682 | borderTopWidth?: any; 683 | 684 | /** 685 | * Sets the width of an element's four borders. This property can have from one to four values. This is a shorthand property for setting values simultaneously for border-top-width, border-right-width, border-bottom-width, and border-left-width. 686 | */ 687 | borderWidth?: any; 688 | 689 | /** 690 | * This property specifies how far an absolutely positioned box's bottom margin edge is offset above the bottom edge of the box's containing block. For relatively positioned boxes, the offset is with respect to the bottom edges of the box itself (i.e., the box is given a position in the normal flow, then offset from that position according to these properties). 691 | */ 692 | bottom?: any; 693 | 694 | /** 695 | * Obsolete. 696 | */ 697 | boxAlign?: any; 698 | 699 | /** 700 | * Breaks a box into fragments creating new borders, padding and repeating backgrounds or lets it stay as a continuous box on a page break, column break, or, for inline elements, at a line break. 701 | */ 702 | boxDecorationBreak?: any; 703 | 704 | /** 705 | * Deprecated 706 | */ 707 | boxDirection?: any; 708 | 709 | /** 710 | * Do not use. This property has been replaced by the flex-wrap property. 711 | * Gets or sets a value that specifies the direction to add successive rows or columns when the value of box-lines is set to multiple. 712 | */ 713 | boxLineProgression?: any; 714 | 715 | /** 716 | * Do not use. This property has been replaced by the flex-wrap property. 717 | * Gets or sets a value that specifies whether child elements wrap onto multiple lines or columns based on the space available in the object. 718 | */ 719 | boxLines?: any; 720 | 721 | /** 722 | * Do not use. This property has been replaced by flex-order. 723 | * Specifies the ordinal group that a child element of the object belongs to. This ordinal value identifies the display order (along the axis defined by the box-orient property) for the group. 724 | */ 725 | boxOrdinalGroup?: any; 726 | 727 | /** 728 | * The CSS break-after property allows you to force a break on multi-column layouts. More specifically, it allows you to force a break after an element. It allows you to determine if a break should occur, and what type of break it should be. The break-after CSS property describes how the page, column or region break behaves after the generated box. If there is no generated box, the property is ignored. 729 | */ 730 | breakAfter?: any; 731 | 732 | /** 733 | * Control page/column/region breaks that fall above a block of content 734 | */ 735 | breakBefore?: any; 736 | 737 | /** 738 | * Control page/column/region breaks that fall within a block of content 739 | */ 740 | breakInside?: any; 741 | 742 | /** 743 | * The clear CSS property specifies if an element can be positioned next to or must be positioned below the floating elements that precede it in the markup. 744 | */ 745 | clear?: any; 746 | 747 | /** 748 | * Deprecated; see clip-path. 749 | * Lets you specify the dimensions of an absolutely positioned element that should be visible, and the element is clipped into this shape, and displayed. 750 | */ 751 | clip?: any; 752 | 753 | /** 754 | * Clipping crops an graphic, so that only a portion of the graphic is rendered, or filled. This clip-rule property, when used with the clip-path property, defines which clip rule, or algorithm, to use when filling the different parts of a graphics. 755 | */ 756 | clipRule?: any; 757 | 758 | /** 759 | * The color property sets the color of an element's foreground content (usually text), accepting any standard CSS color from keywords and hex values to RGB(a) and HSL(a). 760 | */ 761 | color?: any; 762 | 763 | /** 764 | * Specifies how to fill columns (balanced or sequential). 765 | */ 766 | columnFill?: any; 767 | 768 | /** 769 | * The column-gap property controls the width of the gap between columns in multi-column elements. 770 | */ 771 | columnGap?: any; 772 | 773 | /** 774 | * Sets the width, style, and color of the rule between columns. 775 | */ 776 | columnRule?: any; 777 | 778 | /** 779 | * Specifies the color of the rule between columns. 780 | */ 781 | columnRuleColor?: any; 782 | 783 | /** 784 | * Specifies the width of the rule between columns. 785 | */ 786 | columnRuleWidth?: any; 787 | 788 | /** 789 | * The column-span CSS property makes it possible for an element to span across all columns when its value is set to all. An element that spans more than one column is called a spanning element. 790 | */ 791 | columnSpan?: any; 792 | 793 | /** 794 | * Specifies the width of columns in multi-column elements. 795 | */ 796 | columnWidth?: any; 797 | 798 | /** 799 | * This property is a shorthand property for setting column-width and/or column-count. 800 | */ 801 | columns?: any; 802 | 803 | /** 804 | * The counter-increment property accepts one or more names of counters (identifiers), each one optionally followed by an integer which specifies the value by which the counter should be incremented (e.g. if the value is 2, the counter increases by 2 each time it is invoked). 805 | */ 806 | counterIncrement?: any; 807 | 808 | /** 809 | * The counter-reset property contains a list of one or more names of counters, each one optionally followed by an integer (otherwise, the integer defaults to 0.) Each time the given element is invoked, the counters specified by the property are set to the given integer. 810 | */ 811 | counterReset?: any; 812 | 813 | /** 814 | * The cue property specifies sound files (known as an "auditory icon") to be played by speech media agents before and after presenting an element's content; if only one file is specified, it is played both before and after. The volume at which the file(s) should be played, relative to the volume of the main element, may also be specified. The icon files may also be set separately with the cue-before and cue-after properties. 815 | */ 816 | cue?: any; 817 | 818 | /** 819 | * The cue-after property specifies a sound file (known as an "auditory icon") to be played by speech media agents after presenting an element's content; the volume at which the file should be played may also be specified. The shorthand property cue sets cue sounds for both before and after the element is presented. 820 | */ 821 | cueAfter?: any; 822 | 823 | /** 824 | * The direction CSS property specifies the text direction/writing direction. The rtl is used for Hebrew or Arabic text, the ltr is for other languages. 825 | */ 826 | direction?: any; 827 | 828 | /** 829 | * This property specifies the type of rendering box used for an element. It is a shorthand property for many other display properties. 830 | */ 831 | display?: any; 832 | 833 | /** 834 | * The ‘fill’ property paints the interior of the given graphical element. The area to be painted consists of any areas inside the outline of the shape. To determine the inside of the shape, all subpaths are considered, and the interior is determined according to the rules associated with the current value of the ‘fill-rule’ property. The zero-width geometric outline of a shape is included in the area to be painted. 835 | */ 836 | fill?: any; 837 | 838 | /** 839 | * The ‘fill-rule’ property indicates the algorithm which is to be used to determine what parts of the canvas are included inside the shape. For a simple, non-intersecting path, it is intuitively clear what region lies "inside"; however, for a more complex path, such as a path that intersects itself or where one subpath encloses another, the interpretation of "inside" is not so obvious. 840 | * The ‘fill-rule’ property provides two options for how the inside of a shape is determined: 841 | */ 842 | fillRule?: any; 843 | 844 | /** 845 | * Applies various image processing effects. This property is largely unsupported. See Compatibility section for more information. 846 | */ 847 | filter?: any; 848 | 849 | /** 850 | * Obsolete, do not use. This property has been renamed to align-items. 851 | * Specifies the alignment (perpendicular to the layout axis defined by the flex-direction property) of child elements of the object. 852 | */ 853 | flexAlign?: any; 854 | 855 | /** 856 | * The flex-basis CSS property describes the initial main size of the flex item before any free space is distributed according to the flex factors described in the flex property (flex-grow and flex-shrink). 857 | */ 858 | flexBasis?: any; 859 | 860 | /** 861 | * The flex-direction CSS property describes how flex items are placed in the flex container, by setting the direction of the flex container's main axis. 862 | */ 863 | flexDirection?: any; 864 | 865 | /** 866 | * The flex-flow CSS property defines the flex container's main and cross axis. It is a shorthand property for the flex-direction and flex-wrap properties. 867 | */ 868 | flexFlow?: any; 869 | 870 | /** 871 | * Do not use. This property has been renamed to align-self 872 | * Specifies the alignment (perpendicular to the layout axis defined by flex-direction) of child elements of the object. 873 | */ 874 | flexItemAlign?: any; 875 | 876 | /** 877 | * Do not use. This property has been renamed to align-content. 878 | * Specifies how a flexbox's lines align within the flexbox when there is extra space along the axis that is perpendicular to the axis defined by the flex-direction property. 879 | */ 880 | flexLinePack?: any; 881 | 882 | /** 883 | * Gets or sets a value that specifies the ordinal group that a flexbox element belongs to. This ordinal value identifies the display order for the group. 884 | */ 885 | flexOrder?: any; 886 | 887 | /** 888 | * Elements which have the style float are floated horizontally. These elements can move as far to the left or right of the containing element. All elements after the floating element will flow around it, but elements before the floating element are not impacted. If several floating elements are placed after each other, they will float next to each other as long as there is room. 889 | */ 890 | float?: any; 891 | 892 | /** 893 | * Flows content from a named flow (specified by a corresponding flow-into) through selected elements to form a dynamic chain of layout regions. 894 | */ 895 | flowFrom?: any; 896 | 897 | /** 898 | * The font property is shorthand that allows you to do one of two things: you can either set up six of the most mature font properties in one line, or you can set one of a choice of keywords to adopt a system font setting. 899 | */ 900 | font?: any; 901 | 902 | /** 903 | * The font-family property allows one or more font family names and/or generic family names to be specified for usage on the selected element(s)' text. The browser then goes through the list; for each character in the selection it applies the first font family that has an available glyph for that character. 904 | */ 905 | fontFamily?: any; 906 | 907 | /** 908 | * The font-kerning property allows contextual adjustment of inter-glyph spacing, i.e. the spaces between the characters in text. This property controls metric kerning - that utilizes adjustment data contained in the font. Optical Kerning is not supported as yet. 909 | */ 910 | fontKerning?: any; 911 | 912 | /** 913 | * The font-size-adjust property adjusts the font-size of the fallback fonts defined with font-family, so that the x-height is the same no matter what font is used. This preserves the readability of the text when fallback happens. 914 | */ 915 | fontSizeAdjust?: any; 916 | 917 | /** 918 | * Allows you to expand or condense the widths for a normal, condensed, or expanded font face. 919 | */ 920 | fontStretch?: any; 921 | 922 | /** 923 | * The font-style property allows normal, italic, or oblique faces to be selected. Italic forms are generally cursive in nature while oblique faces are typically sloped versions of the regular face. Oblique faces can be simulated by artificially sloping the glyphs of the regular face. 924 | */ 925 | fontStyle?: any; 926 | 927 | /** 928 | * This value specifies whether the user agent is allowed to synthesize bold or oblique font faces when a font family lacks bold or italic faces. 929 | */ 930 | fontSynthesis?: any; 931 | 932 | /** 933 | * The font-variant property enables you to select the small-caps font within a font family. 934 | */ 935 | fontVariant?: any; 936 | 937 | /** 938 | * Fonts can provide alternate glyphs in addition to default glyph for a character. This property provides control over the selection of these alternate glyphs. 939 | */ 940 | fontVariantAlternates?: any; 941 | 942 | /** 943 | * Lays out one or more grid items bound by 4 grid lines. Shorthand for setting grid-column-start, grid-column-end, grid-row-start, and grid-row-end in a single declaration. 944 | */ 945 | gridArea?: any; 946 | 947 | /** 948 | * Controls a grid item's placement in a grid area, particularly grid position and a grid span. Shorthand for setting grid-column-start and grid-column-end in a single declaration. 949 | */ 950 | gridColumn?: any; 951 | 952 | /** 953 | * Controls a grid item's placement in a grid area as well as grid position and a grid span. The grid-column-end property (with grid-row-start, grid-row-end, and grid-column-start) determines a grid item's placement by specifying the grid lines of a grid item's grid area. 954 | */ 955 | gridColumnEnd?: any; 956 | 957 | /** 958 | * Determines a grid item's placement by specifying the starting grid lines of a grid item's grid area . A grid item's placement in a grid area consists of a grid position and a grid span. See also ( grid-row-start, grid-row-end, and grid-column-end) 959 | */ 960 | gridColumnStart?: any; 961 | 962 | /** 963 | * Gets or sets a value that indicates which row an element within a Grid should appear in. Shorthand for setting grid-row-start and grid-row-end in a single declaration. 964 | */ 965 | gridRow?: any; 966 | 967 | /** 968 | * Determines a grid item’s placement by specifying the block-end. A grid item's placement in a grid area consists of a grid position and a grid span. The grid-row-end property (with grid-row-start, grid-column-start, and grid-column-end) determines a grid item's placement by specifying the grid lines of a grid item's grid area. 969 | */ 970 | gridRowEnd?: any; 971 | 972 | /** 973 | * Specifies a row position based upon an integer location, string value, or desired row size. 974 | * css/properties/grid-row is used as short-hand for grid-row-position and grid-row-position 975 | */ 976 | gridRowPosition?: any; 977 | 978 | gridRowSpan?: any; 979 | 980 | /** 981 | * Specifies named grid areas which are not associated with any particular grid item, but can be referenced from the grid-placement properties. The syntax of the grid-template-areas property also provides a visualization of the structure of the grid, making the overall layout of the grid container easier to understand. 982 | */ 983 | gridTemplateAreas?: any; 984 | 985 | /** 986 | * Specifies (with grid-template-rows) the line names and track sizing functions of the grid. Each sizing function can be specified as a length, a percentage of the grid container’s size, a measurement of the contents occupying the column or row, or a fraction of the free space in the grid. 987 | */ 988 | gridTemplateColumns?: any; 989 | 990 | /** 991 | * Specifies (with grid-template-columns) the line names and track sizing functions of the grid. Each sizing function can be specified as a length, a percentage of the grid container’s size, a measurement of the contents occupying the column or row, or a fraction of the free space in the grid. 992 | */ 993 | gridTemplateRows?: any; 994 | 995 | /** 996 | * Sets the height of an element. The content area of the element height does not include the padding, border, and margin of the element. 997 | */ 998 | height?: any; 999 | 1000 | /** 1001 | * Specifies the minimum number of characters in a hyphenated word 1002 | */ 1003 | hyphenateLimitChars?: any; 1004 | 1005 | /** 1006 | * Indicates the maximum number of successive hyphenated lines in an element. The ‘no-limit’ value means that there is no limit. 1007 | */ 1008 | hyphenateLimitLines?: any; 1009 | 1010 | /** 1011 | * Specifies the maximum amount of trailing whitespace (before justification) that may be left in a line before hyphenation is triggered to pull part of a word from the next line back up into the current one. 1012 | */ 1013 | hyphenateLimitZone?: any; 1014 | 1015 | /** 1016 | * Specifies whether or not words in a sentence can be split by the use of a manual or automatic hyphenation mechanism. 1017 | */ 1018 | hyphens?: any; 1019 | 1020 | imeMode?: any; 1021 | 1022 | layoutGrid?: any; 1023 | 1024 | layoutGridChar?: any; 1025 | 1026 | layoutGridLine?: any; 1027 | 1028 | layoutGridMode?: any; 1029 | 1030 | layoutGridType?: any; 1031 | 1032 | /** 1033 | * Sets the left edge of an element 1034 | */ 1035 | left?: any; 1036 | 1037 | /** 1038 | * The letter-spacing CSS property specifies the spacing behavior between text characters. 1039 | */ 1040 | letterSpacing?: any; 1041 | 1042 | /** 1043 | * Deprecated. Gets or sets line-breaking rules for text in selected languages such as Japanese, Chinese, and Korean. 1044 | */ 1045 | lineBreak?: any; 1046 | 1047 | /** 1048 | * Shorthand property that sets the list-style-type, list-style-position and list-style-image properties in one declaration. 1049 | */ 1050 | listStyle?: any; 1051 | 1052 | /** 1053 | * This property sets the image that will be used as the list item marker. When the image is available, it will replace the marker set with the 'list-style-type' marker. That also means that if the image is not available, it will show the style specified by list-style-property 1054 | */ 1055 | listStyleImage?: any; 1056 | 1057 | /** 1058 | * Specifies if the list-item markers should appear inside or outside the content flow. 1059 | */ 1060 | listStylePosition?: any; 1061 | 1062 | /** 1063 | * Specifies the type of list-item marker in a list. 1064 | */ 1065 | listStyleType?: any; 1066 | 1067 | /** 1068 | * The margin property is shorthand to allow you to set all four margins of an element at once. Its equivalent longhand properties are margin-top, margin-right, margin-bottom and margin-left. Negative values are also allowed. 1069 | */ 1070 | margin?: any; 1071 | 1072 | /** 1073 | * margin-bottom sets the bottom margin of an element. 1074 | */ 1075 | marginBottom?: any; 1076 | 1077 | /** 1078 | * margin-left sets the left margin of an element. 1079 | */ 1080 | marginLeft?: any; 1081 | 1082 | /** 1083 | * margin-right sets the right margin of an element. 1084 | */ 1085 | marginRight?: any; 1086 | 1087 | /** 1088 | * margin-top sets the top margin of an element. 1089 | */ 1090 | marginTop?: any; 1091 | 1092 | /** 1093 | * The marquee-direction determines the initial direction in which the marquee content moves. 1094 | */ 1095 | marqueeDirection?: any; 1096 | 1097 | /** 1098 | * The 'marquee-style' property determines a marquee's scrolling behavior. 1099 | */ 1100 | marqueeStyle?: any; 1101 | 1102 | /** 1103 | * This property is shorthand for setting mask-image, mask-mode, mask-repeat, mask-position, mask-clip, mask-origin, mask-composite and mask-size. Omitted values are set to their original properties' initial values. 1104 | */ 1105 | mask?: any; 1106 | 1107 | /** 1108 | * This property is shorthand for setting mask-border-source, mask-border-slice, mask-border-width, mask-border-outset, and mask-border-repeat. Omitted values are set to their original properties' initial values. 1109 | */ 1110 | maskBorder?: any; 1111 | 1112 | /** 1113 | * This property specifies how the images for the sides and the middle part of the mask image are scaled and tiled. The first keyword applies to the horizontal sides, the second one applies to the vertical ones. If the second keyword is absent, it is assumed to be the same as the first, similar to the CSS border-image-repeat property. 1114 | */ 1115 | maskBorderRepeat?: any; 1116 | 1117 | /** 1118 | * This property specifies inward offsets from the top, right, bottom, and left edges of the mask image, dividing it into nine regions: four corners, four edges, and a middle. The middle image part is discarded and treated as fully transparent black unless the fill keyword is present. The four values set the top, right, bottom and left offsets in that order, similar to the CSS border-image-slice property. 1119 | */ 1120 | maskBorderSlice?: any; 1121 | 1122 | /** 1123 | * Specifies an image to be used as a mask. An image that is empty, fails to download, is non-existent, or cannot be displayed is ignored and does not mask the element. 1124 | */ 1125 | maskBorderSource?: any; 1126 | 1127 | /** 1128 | * This property sets the width of the mask box image, similar to the CSS border-image-width property. 1129 | */ 1130 | maskBorderWidth?: any; 1131 | 1132 | /** 1133 | * Determines the mask painting area, which defines the area that is affected by the mask. The painted content of an element may be restricted to this area. 1134 | */ 1135 | maskClip?: any; 1136 | 1137 | /** 1138 | * For elements rendered as a single box, specifies the mask positioning area. For elements rendered as multiple boxes (e.g., inline boxes on several lines, boxes on several pages) specifies which boxes box-decoration-break operates on to determine the mask positioning area(s). 1139 | */ 1140 | maskOrigin?: any; 1141 | 1142 | /** 1143 | * This property must not be used. It is no longer included in any standard or standard track specification, nor is it implemented in any browser. It is only used when the text-align-last property is set to size. It controls allowed adjustments of font-size to fit line content. 1144 | */ 1145 | maxFontSize?: any; 1146 | 1147 | /** 1148 | * Sets the maximum height for an element. It prevents the height of the element to exceed the specified value. If min-height is specified and is greater than max-height, max-height is overridden. 1149 | */ 1150 | maxHeight?: any; 1151 | 1152 | /** 1153 | * Sets the maximum width for an element. It limits the width property to be larger than the value specified in max-width. 1154 | */ 1155 | maxWidth?: any; 1156 | 1157 | /** 1158 | * Sets the minimum height for an element. It prevents the height of the element to be smaller than the specified value. The value of min-height overrides both max-height and height. 1159 | */ 1160 | minHeight?: any; 1161 | 1162 | /** 1163 | * Sets the minimum width of an element. It limits the width property to be not smaller than the value specified in min-width. 1164 | */ 1165 | minWidth?: any; 1166 | 1167 | /** 1168 | * The CSS outline property is a shorthand property for setting one or more of the individual outline properties outline-style, outline-width and outline-color in a single rule. In most cases the use of this shortcut is preferable and more convenient. 1169 | * Outlines differ from borders in the following ways: • Outlines do not take up space, they are drawn above the content. 1170 | * • Outlines may be non-rectangular. They are rectangular in Gecko/Firefox. Internet Explorer attempts to place the smallest contiguous outline around all elements or shapes that are indicated to have an outline. Opera draws a non-rectangular shape around a construct. 1171 | */ 1172 | outline?: any; 1173 | 1174 | /** 1175 | * The outline-color property sets the color of the outline of an element. An outline is a line that is drawn around elements, outside the border edge, to make the element stand out. 1176 | */ 1177 | outlineColor?: any; 1178 | 1179 | /** 1180 | * The outline-offset property offsets the outline and draw it beyond the border edge. 1181 | */ 1182 | outlineOffset?: any; 1183 | 1184 | /** 1185 | * The overflow property controls how extra content exceeding the bounding box of an element is rendered. It can be used in conjunction with an element that has a fixed width and height, to eliminate text-induced page distortion. 1186 | */ 1187 | overflow?: any; 1188 | 1189 | /** 1190 | * Specifies the preferred scrolling methods for elements that overflow. 1191 | */ 1192 | overflowStyle?: any; 1193 | 1194 | /** 1195 | * The overflow-x property is a specific case of the generic overflow property. It controls how extra content exceeding the x-axis of the bounding box of an element is rendered. 1196 | */ 1197 | overflowX?: any; 1198 | 1199 | /** 1200 | * The padding optional CSS property sets the required padding space on one to four sides of an element. The padding area is the space between an element and its border. Negative values are not allowed but decimal values are permitted. The element size is treated as fixed, and the content of the element shifts toward the center as padding is increased. 1201 | * The padding property is a shorthand to avoid setting each side separately (padding-top, padding-right, padding-bottom, padding-left). 1202 | */ 1203 | padding?: any; 1204 | 1205 | /** 1206 | * The padding-bottom CSS property of an element sets the padding space required on the bottom of an element. The padding area is the space between the content of the element and its border. Contrary to margin-bottom values, negative values of padding-bottom are invalid. 1207 | */ 1208 | paddingBottom?: any; 1209 | 1210 | /** 1211 | * The padding-left CSS property of an element sets the padding space required on the left side of an element. The padding area is the space between the content of the element and its border. Contrary to margin-left values, negative values of padding-left are invalid. 1212 | */ 1213 | paddingLeft?: any; 1214 | 1215 | /** 1216 | * The padding-right CSS property of an element sets the padding space required on the right side of an element. The padding area is the space between the content of the element and its border. Contrary to margin-right values, negative values of padding-right are invalid. 1217 | */ 1218 | paddingRight?: any; 1219 | 1220 | /** 1221 | * The padding-top CSS property of an element sets the padding space required on the top of an element. The padding area is the space between the content of the element and its border. Contrary to margin-top values, negative values of padding-top are invalid. 1222 | */ 1223 | paddingTop?: any; 1224 | 1225 | /** 1226 | * The page-break-after property is supported in all major browsers. With CSS3, page-break-* properties are only aliases of the break-* properties. The CSS3 Fragmentation spec defines breaks for all CSS box fragmentation. 1227 | */ 1228 | pageBreakAfter?: any; 1229 | 1230 | /** 1231 | * The page-break-before property sets the page-breaking behavior before an element. With CSS3, page-break-* properties are only aliases of the break-* properties. The CSS3 Fragmentation spec defines breaks for all CSS box fragmentation. 1232 | */ 1233 | pageBreakBefore?: any; 1234 | 1235 | /** 1236 | * Sets the page-breaking behavior inside an element. With CSS3, page-break-* properties are only aliases of the break-* properties. The CSS3 Fragmentation spec defines breaks for all CSS box fragmentation. 1237 | */ 1238 | pageBreakInside?: any; 1239 | 1240 | /** 1241 | * The pause property determines how long a speech media agent should pause before and after presenting an element. It is a shorthand for the pause-before and pause-after properties. 1242 | */ 1243 | pause?: any; 1244 | 1245 | /** 1246 | * The pause-after property determines how long a speech media agent should pause after presenting an element. It may be replaced by the shorthand property pause, which sets pause time before and after. 1247 | */ 1248 | pauseAfter?: any; 1249 | 1250 | /** 1251 | * The pause-before property determines how long a speech media agent should pause before presenting an element. It may be replaced by the shorthand property pause, which sets pause time before and after. 1252 | */ 1253 | pauseBefore?: any; 1254 | 1255 | /** 1256 | * The perspective property defines how far an element is placed from the view on the z-axis, from the screen to the viewer. 1257 | * Perspective defines how an object is viewed. In graphic arts, perspective is the representation on a flat surface of what the viewer's eye would see in a 3D space. (See Wikipedia for more information about graphical perspective and for related illustrations.) 1258 | * The illusion of perspective on a flat surface, such as a computer screen, is created by projecting points on the flat surface as they would appear if the flat surface were a window through which the viewer was looking at the object. In discussion of virtual environments, this flat surface is called a projection plane. 1259 | */ 1260 | perspective?: any; 1261 | 1262 | /** 1263 | * The perspective-origin property establishes the origin for the perspective property. It effectively sets the X and Y position at which the viewer appears to be looking at the children of the element. 1264 | * When used with perspective, perspective-origin changes the appearance of an object, as if a viewer were looking at it from a different origin. An object appears differently if a viewer is looking directly at it versus looking at it from below, above, or from the side. Thus, the perspective-origin is like a vanishing point. 1265 | * The default value of perspective-origin is 50% 50%. This displays an object as if the viewer's eye were positioned directly at the center of the screen, both top-to-bottom and left-to-right. A value of 0% 0% changes the object as if the viewer was looking toward the top left angle. A value of 100% 100% changes the appearance as if viewed toward the bottom right angle. 1266 | */ 1267 | perspectiveOrigin?: any; 1268 | 1269 | /** 1270 | * The pointer-events property allows you to control whether an element can be the target for the pointing device (e.g, mouse, pen) events. 1271 | */ 1272 | pointerEvents?: any; 1273 | 1274 | /** 1275 | * The position property controls the type of positioning used by an element within its parent elements. The effect of the position property depends on a lot of factors, for example the position property of parent elements. 1276 | */ 1277 | position?: any; 1278 | 1279 | /** 1280 | * Obsolete: unsupported. 1281 | * This property determines whether or not a full-width punctuation mark character should be trimmed if it appears at the beginning of a line, so that its "ink" lines up with the first glyph in the line above and below. 1282 | */ 1283 | punctuationTrim?: any; 1284 | 1285 | /** 1286 | * Sets the type of quotation marks for embedded quotations. 1287 | */ 1288 | quotes?: any; 1289 | 1290 | /** 1291 | * Controls whether the last region in a chain displays additional 'overset' content according its default overflow property, or if it displays a fragment of content as if it were flowing into a subsequent region. 1292 | */ 1293 | regionFragment?: any; 1294 | 1295 | /** 1296 | * The rest-after property determines how long a speech media agent should pause after presenting an element's main content, before presenting that element's exit cue sound. It may be replaced by the shorthand property rest, which sets rest time before and after. 1297 | */ 1298 | restAfter?: any; 1299 | 1300 | /** 1301 | * The rest-before property determines how long a speech media agent should pause after presenting an intro cue sound for an element, before presenting that element's main content. It may be replaced by the shorthand property rest, which sets rest time before and after. 1302 | */ 1303 | restBefore?: any; 1304 | 1305 | /** 1306 | * Specifies the position an element in relation to the right side of the containing element. 1307 | */ 1308 | right?: any; 1309 | 1310 | rubyAlign?: any; 1311 | 1312 | rubyPosition?: any; 1313 | 1314 | /** 1315 | * Defines the alpha channel threshold used to extract a shape from an image. Can be thought of as a "minimum opacity" threshold; that is, a value of 0.5 means that the shape will enclose all the pixels that are more than 50% opaque. 1316 | */ 1317 | shapeImageThreshold?: any; 1318 | 1319 | /** 1320 | * A future level of CSS Shapes will define a shape-inside property, which will define a shape to wrap content within the element. See Editor's Draft and CSSWG wiki page on next-level plans 1321 | */ 1322 | shapeInside?: any; 1323 | 1324 | /** 1325 | * Adds a margin to a shape-outside. In effect, defines a new shape that is the smallest contour around all the points that are the shape-margin distance outward perpendicular to each point on the underlying shape. For points where a perpendicular direction is not defined (e.g., a triangle corner), takes all points on a circle centered at the point and with a radius of the shape-margin distance. This property accepts only non-negative values. 1326 | */ 1327 | shapeMargin?: any; 1328 | 1329 | /** 1330 | * Declares a shape around which text should be wrapped, with possible modifications from the shape-margin property. The shape defined by shape-outside and shape-margin changes the geometry of a float element's float area. 1331 | */ 1332 | shapeOutside?: any; 1333 | 1334 | /** 1335 | * The speak property determines whether or not a speech synthesizer will read aloud the contents of an element. 1336 | */ 1337 | speak?: any; 1338 | 1339 | /** 1340 | * The speak-as property determines how the speech synthesizer interprets the content: words as whole words or as a sequence of letters, numbers as a numerical value or a sequence of digits, punctuation as pauses in speech or named punctuation characters. 1341 | */ 1342 | speakAs?: any; 1343 | 1344 | /** 1345 | * The tab-size CSS property is used to customise the width of a tab (U+0009) character. 1346 | */ 1347 | tabSize?: any; 1348 | 1349 | /** 1350 | * The 'table-layout' property controls the algorithm used to lay out the table cells, rows, and columns. 1351 | */ 1352 | tableLayout?: any; 1353 | 1354 | /** 1355 | * The text-align CSS property describes how inline content like text is aligned in its parent block element. text-align does not control the alignment of block elements itself, only their inline content. 1356 | */ 1357 | textAlign?: any; 1358 | 1359 | /** 1360 | * The text-align-last CSS property describes how the last line of a block element or a line before line break is aligned in its parent block element. 1361 | */ 1362 | textAlignLast?: any; 1363 | 1364 | /** 1365 | * The text-decoration CSS property is used to set the text formatting to underline, overline, line-through or blink. 1366 | * underline and overline decorations are positioned under the text, line-through over it. 1367 | */ 1368 | textDecoration?: any; 1369 | 1370 | /** 1371 | * Sets the color of any text decoration, such as underlines, overlines, and strike throughs. 1372 | */ 1373 | textDecorationColor?: any; 1374 | 1375 | /** 1376 | * Sets what kind of line decorations are added to an element, such as underlines, overlines, etc. 1377 | */ 1378 | textDecorationLine?: any; 1379 | 1380 | textDecorationLineThrough?: any; 1381 | 1382 | textDecorationNone?: any; 1383 | 1384 | textDecorationOverline?: any; 1385 | 1386 | /** 1387 | * Specifies what parts of an element’s content are skipped over when applying any text decoration. 1388 | */ 1389 | textDecorationSkip?: any; 1390 | 1391 | /** 1392 | * This property specifies the style of the text decoration line drawn on the specified element. The intended meaning for the values are the same as those of the border-style-properties. 1393 | */ 1394 | textDecorationStyle?: any; 1395 | 1396 | textDecorationUnderline?: any; 1397 | 1398 | /** 1399 | * The text-emphasis property will apply special emphasis marks to the elements text. Slightly similar to the text-decoration property only that this property can have affect on the line-height. It also is noted that this is shorthand for text-emphasis-style and for text-emphasis-color. 1400 | */ 1401 | textEmphasis?: any; 1402 | 1403 | /** 1404 | * The text-emphasis-color property specifies the foreground color of the emphasis marks. 1405 | */ 1406 | textEmphasisColor?: any; 1407 | 1408 | /** 1409 | * The text-emphasis-style property applies special emphasis marks to an element's text. 1410 | */ 1411 | textEmphasisStyle?: any; 1412 | 1413 | /** 1414 | * This property helps determine an inline box's block-progression dimension, derived from the text-height and font-size properties for non-replaced elements, the height or the width for replaced elements, and the stacked block-progression dimension for inline-block elements. The block-progression dimension determines the position of the padding, border and margin for the element. 1415 | */ 1416 | textHeight?: any; 1417 | 1418 | /** 1419 | * Specifies the amount of space horizontally that should be left on the first line of the text of an element. This horizontal spacing is at the beginning of the first line and is in respect to the left edge of the containing block box. 1420 | */ 1421 | textIndent?: any; 1422 | 1423 | textJustifyTrim?: any; 1424 | 1425 | textKashidaSpace?: any; 1426 | 1427 | /** 1428 | * The text-line-through property is a shorthand property for text-line-through-style, text-line-through-color and text-line-through-mode. (Considered obsolete; use text-decoration instead.) 1429 | */ 1430 | textLineThrough?: any; 1431 | 1432 | /** 1433 | * Specifies the line colors for the line-through text decoration. 1434 | * (Considered obsolete; use text-decoration-color instead.) 1435 | */ 1436 | textLineThroughColor?: any; 1437 | 1438 | /** 1439 | * Sets the mode for the line-through text decoration, determining whether the text decoration affects the space characters or not. 1440 | * (Considered obsolete; use text-decoration-skip instead.) 1441 | */ 1442 | textLineThroughMode?: any; 1443 | 1444 | /** 1445 | * Specifies the line style for line-through text decoration. 1446 | * (Considered obsolete; use text-decoration-style instead.) 1447 | */ 1448 | textLineThroughStyle?: any; 1449 | 1450 | /** 1451 | * Specifies the line width for the line-through text decoration. 1452 | */ 1453 | textLineThroughWidth?: any; 1454 | 1455 | /** 1456 | * The text-overflow shorthand CSS property determines how overflowed content that is not displayed is signaled to the users. It can be clipped, display an ellipsis ('…', U+2026 HORIZONTAL ELLIPSIS) or a Web author-defined string. It covers the two long-hand properties text-overflow-mode and text-overflow-ellipsis 1457 | */ 1458 | textOverflow?: any; 1459 | 1460 | /** 1461 | * The text-overline property is the shorthand for the text-overline-style, text-overline-width, text-overline-color, and text-overline-mode properties. 1462 | */ 1463 | textOverline?: any; 1464 | 1465 | /** 1466 | * Specifies the line color for the overline text decoration. 1467 | */ 1468 | textOverlineColor?: any; 1469 | 1470 | /** 1471 | * Sets the mode for the overline text decoration, determining whether the text decoration affects the space characters or not. 1472 | */ 1473 | textOverlineMode?: any; 1474 | 1475 | /** 1476 | * Specifies the line style for overline text decoration. 1477 | */ 1478 | textOverlineStyle?: any; 1479 | 1480 | /** 1481 | * Specifies the line width for the overline text decoration. 1482 | */ 1483 | textOverlineWidth?: any; 1484 | 1485 | /** 1486 | * The text-rendering CSS property provides information to the browser about how to optimize when rendering text. Options are: legibility, speed or geometric precision. 1487 | */ 1488 | textRendering?: any; 1489 | 1490 | /** 1491 | * Obsolete: unsupported. 1492 | */ 1493 | textScript?: any; 1494 | 1495 | /** 1496 | * The CSS text-shadow property applies one or more drop shadows to the text and of an element. Each shadow is specified as an offset from the text, along with optional color and blur radius values. 1497 | */ 1498 | textShadow?: any; 1499 | 1500 | /** 1501 | * This property transforms text for styling purposes. (It has no effect on the underlying content.) 1502 | */ 1503 | textTransform?: any; 1504 | 1505 | /** 1506 | * Unsupported. 1507 | * This property will add a underline position value to the element that has an underline defined. 1508 | */ 1509 | textUnderlinePosition?: any; 1510 | 1511 | /** 1512 | * After review this should be replaced by text-decoration should it not? 1513 | * This property will set the underline style for text with a line value for underline, overline, and line-through. 1514 | */ 1515 | textUnderlineStyle?: any; 1516 | 1517 | /** 1518 | * This property specifies how far an absolutely positioned box's top margin edge is offset below the top edge of the box's containing block. For relatively positioned boxes, the offset is with respect to the top edges of the box itself (i.e., the box is given a position in the normal flow, then offset from that position according to these properties). 1519 | */ 1520 | top?: any; 1521 | 1522 | /** 1523 | * Determines whether touch input may trigger default behavior supplied by the user agent, such as panning or zooming. 1524 | */ 1525 | touchAction?: any; 1526 | 1527 | /** 1528 | * CSS transforms allow elements styled with CSS to be transformed in two-dimensional or three-dimensional space. Using this property, elements can be translated, rotated, scaled, and skewed. The value list may consist of 2D and/or 3D transform values. 1529 | */ 1530 | transform?: any; 1531 | 1532 | /** 1533 | * This property defines the origin of the transformation axes relative to the element to which the transformation is applied. 1534 | */ 1535 | transformOrigin?: any; 1536 | 1537 | /** 1538 | * This property allows you to define the relative position of the origin of the transformation grid along the z-axis. 1539 | */ 1540 | transformOriginZ?: any; 1541 | 1542 | /** 1543 | * This property specifies how nested elements are rendered in 3D space relative to their parent. 1544 | */ 1545 | transformStyle?: any; 1546 | 1547 | /** 1548 | * The transition CSS property is a shorthand property for transition-property, transition-duration, transition-timing-function, and transition-delay. It allows to define the transition between two states of an element. 1549 | */ 1550 | transition?: any; 1551 | 1552 | /** 1553 | * Defines when the transition will start. A value of ‘0s’ means the transition will execute as soon as the property is changed. Otherwise, the value specifies an offset from the moment the property is changed, and the transition will delay execution by that offset. 1554 | */ 1555 | transitionDelay?: any; 1556 | 1557 | /** 1558 | * The 'transition-duration' property specifies the length of time a transition animation takes to complete. 1559 | */ 1560 | transitionDuration?: any; 1561 | 1562 | /** 1563 | * The 'transition-property' property specifies the name of the CSS property to which the transition is applied. 1564 | */ 1565 | transitionProperty?: any; 1566 | 1567 | /** 1568 | * Sets the pace of action within a transition 1569 | */ 1570 | transitionTimingFunction?: any; 1571 | 1572 | /** 1573 | * The unicode-bidi CSS property specifies the level of embedding with respect to the bidirectional algorithm. 1574 | */ 1575 | unicodeBidi?: any; 1576 | 1577 | /** 1578 | * unicode-range allows you to set a specific range of characters to be downloaded from a font (embedded using @font-face) and made available for use on the current page. 1579 | */ 1580 | unicodeRange?: any; 1581 | 1582 | /** 1583 | * This is for all the high level UX stuff. 1584 | */ 1585 | userFocus?: any; 1586 | 1587 | /** 1588 | * For inputing user content 1589 | */ 1590 | userInput?: any; 1591 | 1592 | /** 1593 | * The vertical-align property controls how inline elements or text are vertically aligned compared to the baseline. If this property is used on table-cells it controls the vertical alignment of content of the table cell. 1594 | */ 1595 | verticalAlign?: any; 1596 | 1597 | /** 1598 | * The visibility property specifies whether the boxes generated by an element are rendered. 1599 | */ 1600 | visibility?: any; 1601 | 1602 | /** 1603 | * The voice-balance property sets the apparent position (in stereo sound) of the synthesized voice for spoken media. 1604 | */ 1605 | voiceBalance?: any; 1606 | 1607 | /** 1608 | * The voice-duration property allows the author to explicitly set the amount of time it should take a speech synthesizer to read an element's content, for example to allow the speech to be synchronized with other media. With a value of auto (the default) the length of time it takes to read the content is determined by the content itself and the voice-rate property. 1609 | */ 1610 | voiceDuration?: any; 1611 | 1612 | /** 1613 | * The voice-family property sets the speaker's voice used by a speech media agent to read an element. The speaker may be specified as a named character (to match a voice option in the speech reading software) or as a generic description of the age and gender of the voice. Similar to the font-family property for visual media, a comma-separated list of fallback options may be given in case the speech reader does not recognize the character name or cannot synthesize the requested combination of generic properties. 1614 | */ 1615 | voiceFamily?: any; 1616 | 1617 | /** 1618 | * The voice-pitch property sets pitch or tone (high or low) for the synthesized speech when reading an element; the pitch may be specified absolutely or relative to the normal pitch for the voice-family used to read the text. 1619 | */ 1620 | voicePitch?: any; 1621 | 1622 | /** 1623 | * The voice-range property determines how much variation in pitch or tone will be created by the speech synthesize when reading an element. Emphasized text, grammatical structures and punctuation may all be rendered as changes in pitch, this property determines how strong or obvious those changes are; large ranges are associated with enthusiastic or emotional speech, while small ranges are associated with flat or mechanical speech. 1624 | */ 1625 | voiceRange?: any; 1626 | 1627 | /** 1628 | * The voice-rate property sets the speed at which the voice synthesized by a speech media agent will read content. 1629 | */ 1630 | voiceRate?: any; 1631 | 1632 | /** 1633 | * The voice-stress property sets the level of vocal emphasis to be used for synthesized speech reading the element. 1634 | */ 1635 | voiceStress?: any; 1636 | 1637 | /** 1638 | * The voice-volume property sets the volume for spoken content in speech media. It replaces the deprecated volume property. 1639 | */ 1640 | voiceVolume?: any; 1641 | 1642 | /** 1643 | * The white-space property controls whether and how white space inside the element is collapsed, and whether lines may wrap at unforced "soft wrap" opportunities. 1644 | */ 1645 | whiteSpace?: any; 1646 | 1647 | /** 1648 | * Obsolete: unsupported. 1649 | */ 1650 | whiteSpaceTreatment?: any; 1651 | 1652 | /** 1653 | * Specifies the width of the content area of an element. The content area of the element width does not include the padding, border, and margin of the element. 1654 | */ 1655 | width?: any; 1656 | 1657 | /** 1658 | * The word-break property is often used when there is long generated content that is strung together without and spaces or hyphens to beak apart. A common case of this is when there is a long URL that does not have any hyphens. This case could potentially cause the breaking of the layout as it could extend past the parent element. 1659 | */ 1660 | wordBreak?: any; 1661 | 1662 | /** 1663 | * The word-spacing CSS property specifies the spacing behavior between "words". 1664 | */ 1665 | wordSpacing?: any; 1666 | 1667 | /** 1668 | * An alias of css/properties/overflow-wrap, word-wrap defines whether to break words when the content exceeds the boundaries of its container. 1669 | */ 1670 | wordWrap?: any; 1671 | 1672 | /** 1673 | * Specifies how exclusions affect inline content within block-level elements. Elements lay out their inline content in their content area but wrap around exclusion areas. 1674 | */ 1675 | wrapFlow?: any; 1676 | 1677 | /** 1678 | * Set the value that is used to offset the inner wrap shape from other shapes. Inline content that intersects a shape with this property will be pushed by this shape's margin. 1679 | */ 1680 | wrapMargin?: any; 1681 | 1682 | /** 1683 | * Obsolete and unsupported. Do not use. 1684 | * This CSS property controls the text when it reaches the end of the block in which it is enclosed. 1685 | */ 1686 | wrapOption?: any; 1687 | 1688 | /** 1689 | * writing-mode specifies if lines of text are laid out horizontally or vertically, and the direction which lines of text and blocks progress. 1690 | */ 1691 | writingMode?: any; 1692 | 1693 | 1694 | [propertyName: string]: any; 1695 | } 1696 | 1697 | interface HTMLAttributes extends DOMAttributes { 1698 | // React-specific Attributes 1699 | defaultChecked?: boolean; 1700 | defaultValue?: string | string[]; 1701 | 1702 | // Standard HTML Attributes 1703 | accept?: string; 1704 | acceptCharset?: string; 1705 | accessKey?: string; 1706 | action?: string; 1707 | allowFullScreen?: boolean; 1708 | allowTransparency?: boolean; 1709 | alt?: string; 1710 | async?: boolean; 1711 | autoComplete?: string; 1712 | autoFocus?: boolean; 1713 | autoPlay?: boolean; 1714 | capture?: boolean; 1715 | cellPadding?: number | string; 1716 | cellSpacing?: number | string; 1717 | charSet?: string; 1718 | challenge?: string; 1719 | checked?: boolean; 1720 | classID?: string; 1721 | className?: string; 1722 | cols?: number; 1723 | colSpan?: number; 1724 | content?: string; 1725 | contentEditable?: boolean; 1726 | contextMenu?: string; 1727 | controls?: boolean; 1728 | coords?: string; 1729 | crossOrigin?: string; 1730 | data?: string; 1731 | dateTime?: string; 1732 | default?: boolean; 1733 | defer?: boolean; 1734 | dir?: string; 1735 | disabled?: boolean; 1736 | download?: any; 1737 | draggable?: boolean; 1738 | encType?: string; 1739 | form?: string; 1740 | formAction?: string; 1741 | formEncType?: string; 1742 | formMethod?: string; 1743 | formNoValidate?: boolean; 1744 | formTarget?: string; 1745 | frameBorder?: number | string; 1746 | headers?: string; 1747 | height?: number | string; 1748 | hidden?: boolean; 1749 | high?: number; 1750 | href?: string; 1751 | hrefLang?: string; 1752 | htmlFor?: string; 1753 | httpEquiv?: string; 1754 | icon?: string; 1755 | id?: string; 1756 | inputMode?: string; 1757 | integrity?: string; 1758 | is?: string; 1759 | keyParams?: string; 1760 | keyType?: string; 1761 | kind?: string; 1762 | label?: string; 1763 | lang?: string; 1764 | list?: string; 1765 | loop?: boolean; 1766 | low?: number; 1767 | manifest?: string; 1768 | marginHeight?: number; 1769 | marginWidth?: number; 1770 | max?: number | string; 1771 | maxLength?: number; 1772 | media?: string; 1773 | mediaGroup?: string; 1774 | method?: string; 1775 | min?: number | string; 1776 | minLength?: number; 1777 | multiple?: boolean; 1778 | muted?: boolean; 1779 | name?: string; 1780 | noValidate?: boolean; 1781 | open?: boolean; 1782 | optimum?: number; 1783 | pattern?: string; 1784 | placeholder?: string; 1785 | poster?: string; 1786 | preload?: string; 1787 | radioGroup?: string; 1788 | readOnly?: boolean; 1789 | rel?: string; 1790 | required?: boolean; 1791 | role?: string; 1792 | rows?: number; 1793 | rowSpan?: number; 1794 | sandbox?: string; 1795 | scope?: string; 1796 | scoped?: boolean; 1797 | scrolling?: string; 1798 | seamless?: boolean; 1799 | selected?: boolean; 1800 | shape?: string; 1801 | size?: number; 1802 | sizes?: string; 1803 | span?: number; 1804 | spellCheck?: boolean; 1805 | src?: string; 1806 | srcDoc?: string; 1807 | srcLang?: string; 1808 | srcSet?: string; 1809 | start?: number; 1810 | step?: number | string; 1811 | style?: CSSProperties; 1812 | summary?: string; 1813 | tabIndex?: number; 1814 | target?: string; 1815 | title?: string; 1816 | type?: string; 1817 | useMap?: string; 1818 | value?: string | string[]; 1819 | width?: number | string; 1820 | wmode?: string; 1821 | wrap?: string; 1822 | 1823 | // RDFa Attributes 1824 | about?: string; 1825 | datatype?: string; 1826 | inlist?: any; 1827 | prefix?: string; 1828 | property?: string; 1829 | resource?: string; 1830 | typeof?: string; 1831 | vocab?: string; 1832 | 1833 | // Non-standard Attributes 1834 | autoCapitalize?: string; 1835 | autoCorrect?: string; 1836 | autoSave?: string; 1837 | color?: string; 1838 | itemProp?: string; 1839 | itemScope?: boolean; 1840 | itemType?: string; 1841 | itemID?: string; 1842 | itemRef?: string; 1843 | results?: number; 1844 | security?: string; 1845 | unselectable?: boolean; 1846 | 1847 | // Allows aria- and data- Attributes 1848 | [key: string]: any; 1849 | } 1850 | 1851 | interface SVGAttributes extends HTMLAttributes { 1852 | clipPath?: string; 1853 | cx?: number | string; 1854 | cy?: number | string; 1855 | d?: string; 1856 | dx?: number | string; 1857 | dy?: number | string; 1858 | fill?: string; 1859 | fillOpacity?: number | string; 1860 | fontFamily?: string; 1861 | fontSize?: number | string; 1862 | fx?: number | string; 1863 | fy?: number | string; 1864 | gradientTransform?: string; 1865 | gradientUnits?: string; 1866 | markerEnd?: string; 1867 | markerMid?: string; 1868 | markerStart?: string; 1869 | offset?: number | string; 1870 | opacity?: number | string; 1871 | patternContentUnits?: string; 1872 | patternUnits?: string; 1873 | points?: string; 1874 | preserveAspectRatio?: string; 1875 | r?: number | string; 1876 | rx?: number | string; 1877 | ry?: number | string; 1878 | spreadMethod?: string; 1879 | stopColor?: string; 1880 | stopOpacity?: number | string; 1881 | stroke?: string; 1882 | strokeDasharray?: string; 1883 | strokeLinecap?: string; 1884 | strokeMiterlimit?: string; 1885 | strokeOpacity?: number | string; 1886 | strokeWidth?: number | string; 1887 | textAnchor?: string; 1888 | transform?: string; 1889 | version?: string; 1890 | viewBox?: string; 1891 | x1?: number | string; 1892 | x2?: number | string; 1893 | x?: number | string; 1894 | xlinkActuate?: string; 1895 | xlinkArcrole?: string; 1896 | xlinkHref?: string; 1897 | xlinkRole?: string; 1898 | xlinkShow?: string; 1899 | xlinkTitle?: string; 1900 | xlinkType?: string; 1901 | xmlBase?: string; 1902 | xmlLang?: string; 1903 | xmlSpace?: string; 1904 | y1?: number | string; 1905 | y2?: number | string; 1906 | y?: number | string; 1907 | } 1908 | 1909 | // 1910 | // React.DOM 1911 | // ---------------------------------------------------------------------- 1912 | 1913 | interface ReactDOM { 1914 | // HTML 1915 | a: HTMLFactory; 1916 | abbr: HTMLFactory; 1917 | address: HTMLFactory; 1918 | area: HTMLFactory; 1919 | article: HTMLFactory; 1920 | aside: HTMLFactory; 1921 | audio: HTMLFactory; 1922 | b: HTMLFactory; 1923 | base: HTMLFactory; 1924 | bdi: HTMLFactory; 1925 | bdo: HTMLFactory; 1926 | big: HTMLFactory; 1927 | blockquote: HTMLFactory; 1928 | body: HTMLFactory; 1929 | br: HTMLFactory; 1930 | button: HTMLFactory; 1931 | canvas: HTMLFactory; 1932 | caption: HTMLFactory; 1933 | cite: HTMLFactory; 1934 | code: HTMLFactory; 1935 | col: HTMLFactory; 1936 | colgroup: HTMLFactory; 1937 | data: HTMLFactory; 1938 | datalist: HTMLFactory; 1939 | dd: HTMLFactory; 1940 | del: HTMLFactory; 1941 | details: HTMLFactory; 1942 | dfn: HTMLFactory; 1943 | dialog: HTMLFactory; 1944 | div: HTMLFactory; 1945 | dl: HTMLFactory; 1946 | dt: HTMLFactory; 1947 | em: HTMLFactory; 1948 | embed: HTMLFactory; 1949 | fieldset: HTMLFactory; 1950 | figcaption: HTMLFactory; 1951 | figure: HTMLFactory; 1952 | footer: HTMLFactory; 1953 | form: HTMLFactory; 1954 | h1: HTMLFactory; 1955 | h2: HTMLFactory; 1956 | h3: HTMLFactory; 1957 | h4: HTMLFactory; 1958 | h5: HTMLFactory; 1959 | h6: HTMLFactory; 1960 | head: HTMLFactory; 1961 | header: HTMLFactory; 1962 | hgroup: HTMLFactory; 1963 | hr: HTMLFactory; 1964 | html: HTMLFactory; 1965 | i: HTMLFactory; 1966 | iframe: HTMLFactory; 1967 | img: HTMLFactory; 1968 | input: HTMLFactory; 1969 | ins: HTMLFactory; 1970 | kbd: HTMLFactory; 1971 | keygen: HTMLFactory; 1972 | label: HTMLFactory; 1973 | legend: HTMLFactory; 1974 | li: HTMLFactory; 1975 | link: HTMLFactory; 1976 | main: HTMLFactory; 1977 | map: HTMLFactory; 1978 | mark: HTMLFactory; 1979 | menu: HTMLFactory; 1980 | menuitem: HTMLFactory; 1981 | meta: HTMLFactory; 1982 | meter: HTMLFactory; 1983 | nav: HTMLFactory; 1984 | noscript: HTMLFactory; 1985 | object: HTMLFactory; 1986 | ol: HTMLFactory; 1987 | optgroup: HTMLFactory; 1988 | option: HTMLFactory; 1989 | output: HTMLFactory; 1990 | p: HTMLFactory; 1991 | param: HTMLFactory; 1992 | picture: HTMLFactory; 1993 | pre: HTMLFactory; 1994 | progress: HTMLFactory; 1995 | q: HTMLFactory; 1996 | rp: HTMLFactory; 1997 | rt: HTMLFactory; 1998 | ruby: HTMLFactory; 1999 | s: HTMLFactory; 2000 | samp: HTMLFactory; 2001 | script: HTMLFactory; 2002 | section: HTMLFactory; 2003 | select: HTMLFactory; 2004 | small: HTMLFactory; 2005 | source: HTMLFactory; 2006 | span: HTMLFactory; 2007 | strong: HTMLFactory; 2008 | style: HTMLFactory; 2009 | sub: HTMLFactory; 2010 | summary: HTMLFactory; 2011 | sup: HTMLFactory; 2012 | table: HTMLFactory; 2013 | tbody: HTMLFactory; 2014 | td: HTMLFactory; 2015 | textarea: HTMLFactory; 2016 | tfoot: HTMLFactory; 2017 | th: HTMLFactory; 2018 | thead: HTMLFactory; 2019 | time: HTMLFactory; 2020 | title: HTMLFactory; 2021 | tr: HTMLFactory; 2022 | track: HTMLFactory; 2023 | u: HTMLFactory; 2024 | ul: HTMLFactory; 2025 | "var": HTMLFactory; 2026 | video: HTMLFactory; 2027 | wbr: HTMLFactory; 2028 | 2029 | // SVG 2030 | svg: SVGFactory; 2031 | circle: SVGFactory; 2032 | defs: SVGFactory; 2033 | ellipse: SVGFactory; 2034 | g: SVGFactory; 2035 | image: SVGFactory; 2036 | line: SVGFactory; 2037 | linearGradient: SVGFactory; 2038 | mask: SVGFactory; 2039 | path: SVGFactory; 2040 | pattern: SVGFactory; 2041 | polygon: SVGFactory; 2042 | polyline: SVGFactory; 2043 | radialGradient: SVGFactory; 2044 | rect: SVGFactory; 2045 | stop: SVGFactory; 2046 | text: SVGFactory; 2047 | tspan: SVGFactory; 2048 | } 2049 | 2050 | // 2051 | // React.PropTypes 2052 | // ---------------------------------------------------------------------- 2053 | 2054 | interface Validator { 2055 | (object: T, key: string, componentName: string): Error; 2056 | } 2057 | 2058 | interface Requireable extends Validator { 2059 | isRequired: Validator; 2060 | } 2061 | 2062 | interface ValidationMap { 2063 | [key: string]: Validator; 2064 | } 2065 | 2066 | interface ReactPropTypes { 2067 | any: Requireable; 2068 | array: Requireable; 2069 | bool: Requireable; 2070 | func: Requireable; 2071 | number: Requireable; 2072 | object: Requireable; 2073 | string: Requireable; 2074 | node: Requireable; 2075 | element: Requireable; 2076 | instanceOf(expectedClass: {}): Requireable; 2077 | oneOf(types: any[]): Requireable; 2078 | oneOfType(types: Validator[]): Requireable; 2079 | arrayOf(type: Validator): Requireable; 2080 | objectOf(type: Validator): Requireable; 2081 | shape(type: ValidationMap): Requireable; 2082 | } 2083 | 2084 | // 2085 | // React.Children 2086 | // ---------------------------------------------------------------------- 2087 | 2088 | interface ReactChildren { 2089 | map(children: ReactNode, fn: (child: ReactChild, index: number) => T): T[]; 2090 | forEach(children: ReactNode, fn: (child: ReactChild, index: number) => any): void; 2091 | count(children: ReactNode): number; 2092 | only(children: ReactNode): ReactElement; 2093 | toArray(children: ReactNode): ReactChild[]; 2094 | } 2095 | 2096 | // 2097 | // Browser Interfaces 2098 | // https://github.com/nikeee/2048-typescript/blob/master/2048/js/touch.d.ts 2099 | // ---------------------------------------------------------------------- 2100 | 2101 | interface AbstractView { 2102 | styleMedia: StyleMedia; 2103 | document: Document; 2104 | } 2105 | 2106 | interface Touch { 2107 | identifier: number; 2108 | target: EventTarget; 2109 | screenX: number; 2110 | screenY: number; 2111 | clientX: number; 2112 | clientY: number; 2113 | pageX: number; 2114 | pageY: number; 2115 | } 2116 | 2117 | interface TouchList { 2118 | [index: number]: Touch; 2119 | length: number; 2120 | item(index: number): Touch; 2121 | identifiedTouch(identifier: number): Touch; 2122 | } 2123 | } 2124 | 2125 | declare module "react" { 2126 | export = __React; 2127 | } 2128 | 2129 | declare namespace JSX { 2130 | import React = __React; 2131 | 2132 | interface Element extends React.ReactElement { } 2133 | interface ElementClass extends React.Component { 2134 | render(): JSX.Element; 2135 | } 2136 | interface ElementAttributesProperty { props: {}; } 2137 | 2138 | interface IntrinsicAttributes { 2139 | key?: string | number; 2140 | } 2141 | 2142 | interface IntrinsicClassAttributes { 2143 | ref?: string | ((classInstance: T) => void); 2144 | } 2145 | 2146 | interface IntrinsicElements { 2147 | // HTML 2148 | a: React.HTMLProps; 2149 | abbr: React.HTMLProps; 2150 | address: React.HTMLProps; 2151 | area: React.HTMLProps; 2152 | article: React.HTMLProps; 2153 | aside: React.HTMLProps; 2154 | audio: React.HTMLProps; 2155 | b: React.HTMLProps; 2156 | base: React.HTMLProps; 2157 | bdi: React.HTMLProps; 2158 | bdo: React.HTMLProps; 2159 | big: React.HTMLProps; 2160 | blockquote: React.HTMLProps; 2161 | body: React.HTMLProps; 2162 | br: React.HTMLProps; 2163 | button: React.HTMLProps; 2164 | canvas: React.HTMLProps; 2165 | caption: React.HTMLProps; 2166 | cite: React.HTMLProps; 2167 | code: React.HTMLProps; 2168 | col: React.HTMLProps; 2169 | colgroup: React.HTMLProps; 2170 | data: React.HTMLProps; 2171 | datalist: React.HTMLProps; 2172 | dd: React.HTMLProps; 2173 | del: React.HTMLProps; 2174 | details: React.HTMLProps; 2175 | dfn: React.HTMLProps; 2176 | dialog: React.HTMLProps; 2177 | div: React.HTMLProps; 2178 | dl: React.HTMLProps; 2179 | dt: React.HTMLProps; 2180 | em: React.HTMLProps; 2181 | embed: React.HTMLProps; 2182 | fieldset: React.HTMLProps; 2183 | figcaption: React.HTMLProps; 2184 | figure: React.HTMLProps; 2185 | footer: React.HTMLProps; 2186 | form: React.HTMLProps; 2187 | h1: React.HTMLProps; 2188 | h2: React.HTMLProps; 2189 | h3: React.HTMLProps; 2190 | h4: React.HTMLProps; 2191 | h5: React.HTMLProps; 2192 | h6: React.HTMLProps; 2193 | head: React.HTMLProps; 2194 | header: React.HTMLProps; 2195 | hgroup: React.HTMLProps; 2196 | hr: React.HTMLProps; 2197 | html: React.HTMLProps; 2198 | i: React.HTMLProps; 2199 | iframe: React.HTMLProps; 2200 | img: React.HTMLProps; 2201 | input: React.HTMLProps; 2202 | ins: React.HTMLProps; 2203 | kbd: React.HTMLProps; 2204 | keygen: React.HTMLProps; 2205 | label: React.HTMLProps; 2206 | legend: React.HTMLProps; 2207 | li: React.HTMLProps; 2208 | link: React.HTMLProps; 2209 | main: React.HTMLProps; 2210 | map: React.HTMLProps; 2211 | mark: React.HTMLProps; 2212 | menu: React.HTMLProps; 2213 | menuitem: React.HTMLProps; 2214 | meta: React.HTMLProps; 2215 | meter: React.HTMLProps; 2216 | nav: React.HTMLProps; 2217 | noscript: React.HTMLProps; 2218 | object: React.HTMLProps; 2219 | ol: React.HTMLProps; 2220 | optgroup: React.HTMLProps; 2221 | option: React.HTMLProps; 2222 | output: React.HTMLProps; 2223 | p: React.HTMLProps; 2224 | param: React.HTMLProps; 2225 | picture: React.HTMLProps; 2226 | pre: React.HTMLProps; 2227 | progress: React.HTMLProps; 2228 | q: React.HTMLProps; 2229 | rp: React.HTMLProps; 2230 | rt: React.HTMLProps; 2231 | ruby: React.HTMLProps; 2232 | s: React.HTMLProps; 2233 | samp: React.HTMLProps; 2234 | script: React.HTMLProps; 2235 | section: React.HTMLProps; 2236 | select: React.HTMLProps; 2237 | small: React.HTMLProps; 2238 | source: React.HTMLProps; 2239 | span: React.HTMLProps; 2240 | strong: React.HTMLProps; 2241 | style: React.HTMLProps; 2242 | sub: React.HTMLProps; 2243 | summary: React.HTMLProps; 2244 | sup: React.HTMLProps; 2245 | table: React.HTMLProps; 2246 | tbody: React.HTMLProps; 2247 | td: React.HTMLProps; 2248 | textarea: React.HTMLProps; 2249 | tfoot: React.HTMLProps; 2250 | th: React.HTMLProps; 2251 | thead: React.HTMLProps; 2252 | time: React.HTMLProps; 2253 | title: React.HTMLProps; 2254 | tr: React.HTMLProps; 2255 | track: React.HTMLProps; 2256 | u: React.HTMLProps; 2257 | ul: React.HTMLProps; 2258 | "var": React.HTMLProps; 2259 | video: React.HTMLProps; 2260 | wbr: React.HTMLProps; 2261 | 2262 | // SVG 2263 | svg: React.SVGProps; 2264 | 2265 | circle: React.SVGProps; 2266 | clipPath: React.SVGProps; 2267 | defs: React.SVGProps; 2268 | ellipse: React.SVGProps; 2269 | g: React.SVGProps; 2270 | image: React.SVGProps; 2271 | line: React.SVGProps; 2272 | linearGradient: React.SVGProps; 2273 | mask: React.SVGProps; 2274 | path: React.SVGProps; 2275 | pattern: React.SVGProps; 2276 | polygon: React.SVGProps; 2277 | polyline: React.SVGProps; 2278 | radialGradient: React.SVGProps; 2279 | rect: React.SVGProps; 2280 | stop: React.SVGProps; 2281 | text: React.SVGProps; 2282 | tspan: React.SVGProps; 2283 | } 2284 | } 2285 | -------------------------------------------------------------------------------- /typings/tsd.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | /// 3 | /// 4 | -------------------------------------------------------------------------------- /webpack.config.js: -------------------------------------------------------------------------------- 1 | var path = require('path'); 2 | var webpack = require('webpack'); 3 | 4 | module.exports = { 5 | devtool: 'eval', 6 | entry: [ 7 | 'webpack-dev-server/client?http://localhost:3000', 8 | 'webpack/hot/only-dev-server', 9 | './src/index' 10 | ], 11 | output: { 12 | path: path.join(__dirname, 'dist'), 13 | filename: 'bundle.js', 14 | publicPath: '/static/' 15 | }, 16 | plugins: [ 17 | new webpack.HotModuleReplacementPlugin(), 18 | new webpack.NoErrorsPlugin() 19 | ], 20 | resolve: { 21 | extensions: ['', '.js', '.ts', '.tsx', '.json'] 22 | }, 23 | module: { 24 | loaders: [ 25 | { 26 | test: /\.css$/, 27 | loader: "style!css" 28 | }, 29 | { 30 | test: /\.json$/, 31 | loaders: ['json-loader'] 32 | }, 33 | { 34 | test: /\.tsx?$/, 35 | loaders: ['react-hot/webpack', 'ts-loader'], 36 | include: path.join(__dirname, 'src') 37 | } 38 | ] 39 | } 40 | }; 41 | --------------------------------------------------------------------------------