From 10d1e20c6a979be8253cfb73c4024e92beef81c0 Mon Sep 17 00:00:00 2001 From: David Hara Date: Fri, 26 Feb 2016 02:29:45 -0800 Subject: [PATCH 01/81] Initial commit --- griddle-react/.gitignore | 33 +++++++++++++++++++++++++++++++++ griddle-react/LICENSE | 21 +++++++++++++++++++++ griddle-react/README.md | 2 ++ 3 files changed, 56 insertions(+) create mode 100644 griddle-react/.gitignore create mode 100644 griddle-react/LICENSE create mode 100644 griddle-react/README.md diff --git a/griddle-react/.gitignore b/griddle-react/.gitignore new file mode 100644 index 0000000000..e920c16718 --- /dev/null +++ b/griddle-react/.gitignore @@ -0,0 +1,33 @@ +# Logs +logs +*.log +npm-debug.log* + +# Runtime data +pids +*.pid +*.seed + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage + +# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# node-waf configuration +.lock-wscript + +# Compiled binary addons (http://nodejs.org/api/addons.html) +build/Release + +# Dependency directory +node_modules + +# Optional npm cache directory +.npm + +# Optional REPL history +.node_repl_history diff --git a/griddle-react/LICENSE b/griddle-react/LICENSE new file mode 100644 index 0000000000..0794d0b4a6 --- /dev/null +++ b/griddle-react/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2016 David Hara + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/griddle-react/README.md b/griddle-react/README.md new file mode 100644 index 0000000000..5effe58bf5 --- /dev/null +++ b/griddle-react/README.md @@ -0,0 +1,2 @@ +# griddle-react-typings +Type definition for http://griddlegriddle.github.io/ From 2d231a94d736d37372cf1d2767bbeddd56ce653f Mon Sep 17 00:00:00 2001 From: David Hara Date: Fri, 26 Feb 2016 02:41:38 -0800 Subject: [PATCH 02/81] first pass --- griddle-react/.gitignore | 5 ++ griddle-react/README.md | 7 +++ griddle-react/griddle-react.d.ts | 101 +++++++++++++++++++++++++++++++ griddle-react/tsconfig.json | 11 ++++ griddle-react/typings.json | 8 +++ 5 files changed, 132 insertions(+) create mode 100644 griddle-react/griddle-react.d.ts create mode 100644 griddle-react/tsconfig.json create mode 100644 griddle-react/typings.json diff --git a/griddle-react/.gitignore b/griddle-react/.gitignore index e920c16718..073b01eae5 100644 --- a/griddle-react/.gitignore +++ b/griddle-react/.gitignore @@ -1,3 +1,8 @@ +*.iml +.idea +/target +/typings + # Logs logs *.log diff --git a/griddle-react/README.md b/griddle-react/README.md index 5effe58bf5..a4d789c3ea 100644 --- a/griddle-react/README.md +++ b/griddle-react/README.md @@ -1,2 +1,9 @@ # griddle-react-typings Type definition for http://griddlegriddle.github.io/ + +Depends upon the [ambient react type definitions](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/c2c22c3b953fe9730d4802022d5e0d18d083909e/react) (github:DefinitelyTyped/DefinitelyTyped/react/react.d.ts#f407264835650f5f38d4bb2c515a79e7a835916b) +which you can install with + +``` +typings install react --ambient +``` \ No newline at end of file diff --git a/griddle-react/griddle-react.d.ts b/griddle-react/griddle-react.d.ts new file mode 100644 index 0000000000..f590635746 --- /dev/null +++ b/griddle-react/griddle-react.d.ts @@ -0,0 +1,101 @@ +declare module "griddle-react" { + import * as React from 'react'; + + //TODO: Find good way to export this, and set it as first type argument on ColumnMetaData.customComponent + export interface CustomColumnComponentProps { + data: any, + rowData: T, + metaData: ColumnMetaData + } + + interface ColumnMetaData { + columnName: string; + order?: number; + locked?: boolean; + cssClassName?: string; + displayName?: string; + customComponent?: any; //TODO: should be React.Component, but getting weird error. + } + + interface BodyCssClassNameFunction { + (rowData:T): string; + } + + interface RowMetaData { + bodyCssClassName?: BodyCssClassNameFunction | string; + } + + interface GriddleProps { + columns?: string[]; + columnMetadata?: ColumnMetaData[]; + rowMetadata?: RowMetaData; + results?: T; + resultsPerPage?: number; + initialSort?: string; + initialSortAscending?: boolean; + gridClassName?: string; + tableClassName?: string; + customFormatClassName?: string; + settingsText?: string; + filterPlaceholderText?: string; + nextText?: string; + previousText?: string; + maxRowsText?: string; + enableCustomFormatText?: string; + childrenColumnName?: string; + metadataColumns?: string[]; + showFilter?: boolean; + showSettings?: boolean; + useCustomRowComponent?: boolean; + useCustomGridComponent?: boolean; + useCustomPagerComponent?: boolean; + useGriddleStyles?: boolean; + customRowComponent?: any; //TODO: should be React.Component, but getting weird error. + customGridComponent?: any; //TODO: should be React.Component, but getting weird error. + customPagerComponent?: any; //TODO: should be React.Component, but getting weird error. + enableToggleCustom?: boolean; + noDataMessage?: string; + noDataClassName?: string; + customNoDataComponent?: any; //TODO: should be React.Component, but getting weird error. + showTableHeading?: boolean; + showPager?: boolean; + useFixedHeader?: boolean; + useExternal?: boolean; + externalSetPage?(index: number): void; + externalChangeSort?(sort: string, sortAscending: boolean): void; + externalSetFilter?(filter: string): void; + externalSetPageSize?(size: number): void; + externalMaxPage?: number; + externalCurrentPage?: number; + externalSortColumn?: string; + externalSortAscending?: boolean; + externalLoadingComponent?: any; //TODO: should be React.Component, but getting weird error. + externalIsLoading?: boolean; + enableInfiniteScroll?: boolean; + bodyHeight?: number; + paddingHeight?: number; + rowHeight?: number; + infiniteScrollLoadTreshold?: number; + useFixedLayout?: boolean; + isSubGriddle?: boolean; + enableSort?: boolean; + sortAscendingClassName?: string; + sortDescendingClassName?: string; + parentRowCollapsedClassName?: string; + parentRowExpandedClassName?: string; + settingsToggleClassName?: string; + nextClassName?: string; + previousClassName?: string; + sortAscendingComponent?: string | React.ReactElement; + sortDescendingComponent?: string | React.ReactElement; + sortDefaultComponent?: string | React.ReactElement; + parentRowCollapsedComponent?: string | React.ReactElement; + parentRowExpandedComponent?: string | React.ReactElement; + settingsIconComponent?: string | React.ReactElement; + nextIconComponent?: string | React.ReactElement; + previousIconComponent?: string | React.ReactElement; + onRowClick?(): void; + } + + export default class Griddle extends React.Component, any> {} +} \ No newline at end of file diff --git a/griddle-react/tsconfig.json b/griddle-react/tsconfig.json new file mode 100644 index 0000000000..bb0f92d33a --- /dev/null +++ b/griddle-react/tsconfig.json @@ -0,0 +1,11 @@ +{ + "compilerOptions": { + "module": "commonjs", + "outDir": "./target", + "jsx": "react", + "target": "es6" + }, + "exclude": [ + "node_modules" + ] +} \ No newline at end of file diff --git a/griddle-react/typings.json b/griddle-react/typings.json new file mode 100644 index 0000000000..83f0e8e61c --- /dev/null +++ b/griddle-react/typings.json @@ -0,0 +1,8 @@ +{ + "name": "griddle-react", + "main": "griddle-react.d.ts", + "dependencies": {}, + "ambientDependencies": { + "react": "github:DefinitelyTyped/DefinitelyTyped/react/react.d.ts#f407264835650f5f38d4bb2c515a79e7a835916b" + } +} From a4b1839c144d370f37b37a51c68fc50cc7161fbb Mon Sep 17 00:00:00 2001 From: David Hara Date: Fri, 26 Feb 2016 02:48:03 -0800 Subject: [PATCH 03/81] Update README.md --- griddle-react/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/griddle-react/README.md b/griddle-react/README.md index a4d789c3ea..2fa98f3157 100644 --- a/griddle-react/README.md +++ b/griddle-react/README.md @@ -1,9 +1,9 @@ # griddle-react-typings -Type definition for http://griddlegriddle.github.io/ +Type definition for https://griddlegriddle.github.io/Griddle/ Depends upon the [ambient react type definitions](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/c2c22c3b953fe9730d4802022d5e0d18d083909e/react) (github:DefinitelyTyped/DefinitelyTyped/react/react.d.ts#f407264835650f5f38d4bb2c515a79e7a835916b) which you can install with ``` typings install react --ambient -``` \ No newline at end of file +``` From a7d3f0ec1f9c4ce9023d2ce15115f23a571f418f Mon Sep 17 00:00:00 2001 From: David Hara Date: Mon, 29 Feb 2016 20:20:35 -0800 Subject: [PATCH 04/81] remove ambient module declaration --- griddle-react/griddle-react.d.ts | 190 +++++++++++++++---------------- 1 file changed, 95 insertions(+), 95 deletions(-) diff --git a/griddle-react/griddle-react.d.ts b/griddle-react/griddle-react.d.ts index f590635746..090640e5ed 100644 --- a/griddle-react/griddle-react.d.ts +++ b/griddle-react/griddle-react.d.ts @@ -1,101 +1,101 @@ -declare module "griddle-react" { - import * as React from 'react'; +import * as React from 'react'; - //TODO: Find good way to export this, and set it as first type argument on ColumnMetaData.customComponent - export interface CustomColumnComponentProps { - data: any, - rowData: T, - metaData: ColumnMetaData - } +//TODO: Find good way to export this, and set it as first type argument on ColumnMetaData.customComponent +interface CustomColumnComponentProps { + data: any, + rowData: T, + metaData: ColumnMetaData +} - interface ColumnMetaData { - columnName: string; - order?: number; - locked?: boolean; - cssClassName?: string; - displayName?: string; - customComponent?: any; //TODO: should be React.Component, but getting weird error. - } +interface ColumnMetaData { + columnName: string; + order?: number; + locked?: boolean; + cssClassName?: string; + displayName?: string; + customComponent?: any; //TODO: should be React.Component, but getting weird error. +} - interface BodyCssClassNameFunction { - (rowData:T): string; - } +interface BodyCssClassNameFunction { + (rowData:T): string; +} - interface RowMetaData { - bodyCssClassName?: BodyCssClassNameFunction | string; - } +interface RowMetaData { + bodyCssClassName?: BodyCssClassNameFunction | string; +} - interface GriddleProps { - columns?: string[]; - columnMetadata?: ColumnMetaData[]; - rowMetadata?: RowMetaData; - results?: T; - resultsPerPage?: number; - initialSort?: string; - initialSortAscending?: boolean; - gridClassName?: string; - tableClassName?: string; - customFormatClassName?: string; - settingsText?: string; - filterPlaceholderText?: string; - nextText?: string; - previousText?: string; - maxRowsText?: string; - enableCustomFormatText?: string; - childrenColumnName?: string; - metadataColumns?: string[]; - showFilter?: boolean; - showSettings?: boolean; - useCustomRowComponent?: boolean; - useCustomGridComponent?: boolean; - useCustomPagerComponent?: boolean; - useGriddleStyles?: boolean; - customRowComponent?: any; //TODO: should be React.Component, but getting weird error. - customGridComponent?: any; //TODO: should be React.Component, but getting weird error. - customPagerComponent?: any; //TODO: should be React.Component, but getting weird error. - enableToggleCustom?: boolean; - noDataMessage?: string; - noDataClassName?: string; - customNoDataComponent?: any; //TODO: should be React.Component, but getting weird error. - showTableHeading?: boolean; - showPager?: boolean; - useFixedHeader?: boolean; - useExternal?: boolean; - externalSetPage?(index: number): void; - externalChangeSort?(sort: string, sortAscending: boolean): void; - externalSetFilter?(filter: string): void; - externalSetPageSize?(size: number): void; - externalMaxPage?: number; - externalCurrentPage?: number; - externalSortColumn?: string; - externalSortAscending?: boolean; - externalLoadingComponent?: any; //TODO: should be React.Component, but getting weird error. - externalIsLoading?: boolean; - enableInfiniteScroll?: boolean; - bodyHeight?: number; - paddingHeight?: number; - rowHeight?: number; - infiniteScrollLoadTreshold?: number; - useFixedLayout?: boolean; - isSubGriddle?: boolean; - enableSort?: boolean; - sortAscendingClassName?: string; - sortDescendingClassName?: string; - parentRowCollapsedClassName?: string; - parentRowExpandedClassName?: string; - settingsToggleClassName?: string; - nextClassName?: string; - previousClassName?: string; - sortAscendingComponent?: string | React.ReactElement; - sortDescendingComponent?: string | React.ReactElement; - sortDefaultComponent?: string | React.ReactElement; - parentRowCollapsedComponent?: string | React.ReactElement; - parentRowExpandedComponent?: string | React.ReactElement; - settingsIconComponent?: string | React.ReactElement; - nextIconComponent?: string | React.ReactElement; - previousIconComponent?: string | React.ReactElement; - onRowClick?(): void; - } +interface GriddleProps { + columns?: string[]; + columnMetadata?: ColumnMetaData[]; + rowMetadata?: RowMetaData; + results?: T; + resultsPerPage?: number; + initialSort?: string; + initialSortAscending?: boolean; + gridClassName?: string; + tableClassName?: string; + customFormatClassName?: string; + settingsText?: string; + filterPlaceholderText?: string; + nextText?: string; + previousText?: string; + maxRowsText?: string; + enableCustomFormatText?: string; + childrenColumnName?: string; + metadataColumns?: string[]; + showFilter?: boolean; + showSettings?: boolean; + useCustomRowComponent?: boolean; + useCustomGridComponent?: boolean; + useCustomPagerComponent?: boolean; + useGriddleStyles?: boolean; + customRowComponent?: any; //TODO: should be React.Component, but getting weird error. + customGridComponent?: any; //TODO: should be React.Component, but getting weird error. + customPagerComponent?: any; //TODO: should be React.Component, but getting weird error. + enableToggleCustom?: boolean; + noDataMessage?: string; + noDataClassName?: string; + customNoDataComponent?: any; //TODO: should be React.Component, but getting weird error. + showTableHeading?: boolean; + showPager?: boolean; + useFixedHeader?: boolean; + useExternal?: boolean; + externalSetPage?(index: number): void; + externalChangeSort?(sort: string, sortAscending: boolean): void; + externalSetFilter?(filter: string): void; + externalSetPageSize?(size: number): void; + externalMaxPage?: number; + externalCurrentPage?: number; + externalSortColumn?: string; + externalSortAscending?: boolean; + externalLoadingComponent?: any; //TODO: should be React.Component, but getting weird error. + externalIsLoading?: boolean; + enableInfiniteScroll?: boolean; + bodyHeight?: number; + paddingHeight?: number; + rowHeight?: number; + infiniteScrollLoadTreshold?: number; + useFixedLayout?: boolean; + isSubGriddle?: boolean; + enableSort?: boolean; + sortAscendingClassName?: string; + sortDescendingClassName?: string; + parentRowCollapsedClassName?: string; + parentRowExpandedClassName?: string; + settingsToggleClassName?: string; + nextClassName?: string; + previousClassName?: string; + sortAscendingComponent?: string | React.ReactElement; + sortDescendingComponent?: string | React.ReactElement; + sortDefaultComponent?: string | React.ReactElement; + parentRowCollapsedComponent?: string | React.ReactElement; + parentRowExpandedComponent?: string | React.ReactElement; + settingsIconComponent?: string | React.ReactElement; + nextIconComponent?: string | React.ReactElement; + previousIconComponent?: string | React.ReactElement; + onRowClick?(): void; +} - export default class Griddle extends React.Component, any> {} -} \ No newline at end of file +declare class Griddle extends React.Component, any> {} + +export default Griddle; \ No newline at end of file From 38dc86e9841b4c4754f7a177e617ef33baa2acde Mon Sep 17 00:00:00 2001 From: David Hara Date: Wed, 2 Mar 2016 22:40:59 -0800 Subject: [PATCH 05/81] Improve testability, and update results type to fix #2 --- griddle-react/.babelrc | 3 ++ griddle-react/README.md | 10 ++++- griddle-react/griddle-react.d.ts | 2 +- griddle-react/package.json | 32 ++++++++++++++++ griddle-react/test/index.html | 9 +++++ griddle-react/test/test.tsx | 66 ++++++++++++++++++++++++++++++++ griddle-react/tsconfig.json | 9 +++-- griddle-react/webpack.config.js | 17 ++++++++ 8 files changed, 143 insertions(+), 5 deletions(-) create mode 100644 griddle-react/.babelrc create mode 100644 griddle-react/package.json create mode 100644 griddle-react/test/index.html create mode 100644 griddle-react/test/test.tsx create mode 100644 griddle-react/webpack.config.js diff --git a/griddle-react/.babelrc b/griddle-react/.babelrc new file mode 100644 index 0000000000..facd180928 --- /dev/null +++ b/griddle-react/.babelrc @@ -0,0 +1,3 @@ +{ + "presets": ["es2015", "react"] +} \ No newline at end of file diff --git a/griddle-react/README.md b/griddle-react/README.md index 2fa98f3157..c5479bfd3b 100644 --- a/griddle-react/README.md +++ b/griddle-react/README.md @@ -2,8 +2,16 @@ Type definition for https://griddlegriddle.github.io/Griddle/ Depends upon the [ambient react type definitions](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/c2c22c3b953fe9730d4802022d5e0d18d083909e/react) (github:DefinitelyTyped/DefinitelyTyped/react/react.d.ts#f407264835650f5f38d4bb2c515a79e7a835916b) -which you can install with +which you can install with: ``` typings install react --ambient ``` +## Testing +run: +``` +npm install +npm test +``` + +then open your browser to http://localhost:8080/webpack-dev-server/test/ \ No newline at end of file diff --git a/griddle-react/griddle-react.d.ts b/griddle-react/griddle-react.d.ts index 090640e5ed..e5815153bd 100644 --- a/griddle-react/griddle-react.d.ts +++ b/griddle-react/griddle-react.d.ts @@ -28,7 +28,7 @@ interface GriddleProps { columns?: string[]; columnMetadata?: ColumnMetaData[]; rowMetadata?: RowMetaData; - results?: T; + results?: T[]; resultsPerPage?: number; initialSort?: string; initialSortAscending?: boolean; diff --git a/griddle-react/package.json b/griddle-react/package.json new file mode 100644 index 0000000000..66d209bd20 --- /dev/null +++ b/griddle-react/package.json @@ -0,0 +1,32 @@ +{ + "name": "griddle-react-typings", + "version": "1.0.0", + "description": "", + "repository": { + "type": "git", + "url": "https://github.com/hodavidhara/griddle-react-typings.git" + }, + "main": "griddle-react.d.ts", + "scripts": { + "test": "typings install file:$(npm root)/../griddle-react.d.ts --name griddle-react && webpack-dev-server" + }, + "author": "", + "license": "MIT", + "dependencies": { + "griddle-react": "^0.3.1", + "react": "^0.14.7", + "react-dom": "^0.14.7", + "underscore": "^1.8.3" + }, + "devDependencies": { + "babel-core": "^6.6.4", + "babel-loader": "^6.2.4", + "babel-preset-es2015": "^6.6.0", + "babel-preset-react": "^6.5.0", + "ts-loader": "^0.8.1", + "typescript": "^1.8.7", + "typings": "^0.6.9", + "webpack": "^1.12.14", + "webpack-dev-server": "^1.14.1" + } +} diff --git a/griddle-react/test/index.html b/griddle-react/test/index.html new file mode 100644 index 0000000000..2ce79ad3c7 --- /dev/null +++ b/griddle-react/test/index.html @@ -0,0 +1,9 @@ + + + + + +
+ + + \ No newline at end of file diff --git a/griddle-react/test/test.tsx b/griddle-react/test/test.tsx new file mode 100644 index 0000000000..2e688014e1 --- /dev/null +++ b/griddle-react/test/test.tsx @@ -0,0 +1,66 @@ +import * as React from 'react'; +import {render} from 'react-dom'; +import Griddle from 'griddle-react'; + +class TestComponent extends React.Component { + render() { + return ( +
+ ); + } +} + +interface MyCustomResult { + name: string, + test: string +} + +class LinkComponent extends React.Component { + render() { + var url = "speakers/" + this.props.rowData.test + "/" + this.props.data; + return {this.props.data} + } +} + +var columnMeta = [ + { + columnName: "name", + order: 1, + locked: false, + visible: true, + customComponent: LinkComponent + }]; + +var results = [ + { + name: 'David Hara', + test: 'blah' + }, + { + name: 'Hara, David', + test: 'blah2' + } +]; + +var rowMetaData = { + bodyCssClassName: (rowData: MyCustomResult) => { + return rowData.test; + } +}; + +type TypedGriddle = new () => Griddle; +const TypedGriddle = Griddle as TypedGriddle; + +render( +
+ } + sortDescendingComponent={} + customRowComponent={LinkComponent} + /> +
, + document.getElementById('root') +); \ No newline at end of file diff --git a/griddle-react/tsconfig.json b/griddle-react/tsconfig.json index bb0f92d33a..7f01a8e329 100644 --- a/griddle-react/tsconfig.json +++ b/griddle-react/tsconfig.json @@ -1,11 +1,14 @@ { "compilerOptions": { - "module": "commonjs", + "module": "es2015", "outDir": "./target", - "jsx": "react", + "jsx": "preserve", "target": "es6" }, "exclude": [ - "node_modules" + "node_modules", + "griddle-react.d.ts", + "typings/main", + "typings/main.d.ts" ] } \ No newline at end of file diff --git a/griddle-react/webpack.config.js b/griddle-react/webpack.config.js new file mode 100644 index 0000000000..f2f79ea1e4 --- /dev/null +++ b/griddle-react/webpack.config.js @@ -0,0 +1,17 @@ +module.exports = { + entry: ['./test/test.tsx'], + output: { + path: '/', + filename: 'bundle.js' + }, + module: { + loaders: [ + { + test: /.tsx?$/, + loaders: ['babel-loader', 'ts-loader'], + exclude: /node_modules/ + } + ] + }, + devtool: "#source-map" +}; \ No newline at end of file From c05d14f1e52a9c352fd710e1e94a9b0c30c2772c Mon Sep 17 00:00:00 2001 From: David Hara Date: Wed, 2 Mar 2016 23:28:25 -0800 Subject: [PATCH 06/81] Export interfaces --- griddle-react/griddle-react.d.ts | 11 +++++------ griddle-react/test/test.tsx | 4 ++-- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/griddle-react/griddle-react.d.ts b/griddle-react/griddle-react.d.ts index e5815153bd..0096f65eb3 100644 --- a/griddle-react/griddle-react.d.ts +++ b/griddle-react/griddle-react.d.ts @@ -1,13 +1,12 @@ import * as React from 'react'; -//TODO: Find good way to export this, and set it as first type argument on ColumnMetaData.customComponent -interface CustomColumnComponentProps { +export interface CustomColumnComponentProps { data: any, rowData: T, metaData: ColumnMetaData } -interface ColumnMetaData { +export interface ColumnMetaData { columnName: string; order?: number; locked?: boolean; @@ -16,15 +15,15 @@ interface ColumnMetaData { customComponent?: any; //TODO: should be React.Component, but getting weird error. } -interface BodyCssClassNameFunction { +export interface BodyCssClassNameFunction { (rowData:T): string; } -interface RowMetaData { +export interface RowMetaData { bodyCssClassName?: BodyCssClassNameFunction | string; } -interface GriddleProps { +export interface GriddleProps { columns?: string[]; columnMetadata?: ColumnMetaData[]; rowMetadata?: RowMetaData; diff --git a/griddle-react/test/test.tsx b/griddle-react/test/test.tsx index 2e688014e1..965e70018f 100644 --- a/griddle-react/test/test.tsx +++ b/griddle-react/test/test.tsx @@ -1,6 +1,6 @@ import * as React from 'react'; import {render} from 'react-dom'; -import Griddle from 'griddle-react'; +import {default as Griddle, CustomColumnComponentProps} from 'griddle-react'; class TestComponent extends React.Component { render() { @@ -15,7 +15,7 @@ interface MyCustomResult { test: string } -class LinkComponent extends React.Component { +class LinkComponent extends React.Component, any> { render() { var url = "speakers/" + this.props.rowData.test + "/" + this.props.data; return {this.props.data} From 53751327914aaa9494b1b187cf22f7b6aae68579 Mon Sep 17 00:00:00 2001 From: David Hara Date: Mon, 14 Mar 2016 22:10:48 -0700 Subject: [PATCH 07/81] set up CI tests --- griddle-react/.travis.yml | 5 +++++ griddle-react/package.json | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 griddle-react/.travis.yml diff --git a/griddle-react/.travis.yml b/griddle-react/.travis.yml new file mode 100644 index 0000000000..c5c95c6331 --- /dev/null +++ b/griddle-react/.travis.yml @@ -0,0 +1,5 @@ +language: node_js +node_js: + - "5.8" + - "5.7" + - "4.4" \ No newline at end of file diff --git a/griddle-react/package.json b/griddle-react/package.json index 66d209bd20..2b0b55b62e 100644 --- a/griddle-react/package.json +++ b/griddle-react/package.json @@ -8,7 +8,8 @@ }, "main": "griddle-react.d.ts", "scripts": { - "test": "typings install file:$(npm root)/../griddle-react.d.ts --name griddle-react && webpack-dev-server" + "test": "typings install file:$(npm root)/../griddle-react.d.ts --name griddle-react && tsc", + "server": "webpack-dev-server" }, "author": "", "license": "MIT", From 022932b0f189ee9bf5ad75f3e43b157761a408cd Mon Sep 17 00:00:00 2001 From: David Hara Date: Mon, 14 Mar 2016 22:56:06 -0700 Subject: [PATCH 08/81] Fixed components! --- griddle-react/griddle-react.d.ts | 185 +++++++++++++++++-------------- griddle-react/test/test.tsx | 91 ++++++++------- 2 files changed, 147 insertions(+), 129 deletions(-) diff --git a/griddle-react/griddle-react.d.ts b/griddle-react/griddle-react.d.ts index 0096f65eb3..a4e8a6a584 100644 --- a/griddle-react/griddle-react.d.ts +++ b/griddle-react/griddle-react.d.ts @@ -1,100 +1,121 @@ import * as React from 'react'; +type ReactClass = React.ComponentClass | React.StatelessComponent + export interface CustomColumnComponentProps { - data: any, - rowData: T, - metaData: ColumnMetaData + data: any; + rowData: T; + metaData: ColumnMetaData; } -export interface ColumnMetaData { - columnName: string; - order?: number; - locked?: boolean; - cssClassName?: string; - displayName?: string; - customComponent?: any; //TODO: should be React.Component, but getting weird error. +export interface CustomRowComponentProps { + data: T; +} + +export interface CustomGridComponentProps { + data: T[]; +} + +export interface CustomPagerComponentProps { + currentPage: number; + maxPage: number; + nextText: string; + previousText: string; + next(): void; + previous(): void; + setPage(number: number): void; +} + +export interface ColumnMetaData { + columnName: string; + order?: number; + locked?: boolean; + cssClassName?: string; + displayName?: string; + customComponent?: ReactClass>; } export interface BodyCssClassNameFunction { - (rowData:T): string; + (rowData: T): string; } export interface RowMetaData { - bodyCssClassName?: BodyCssClassNameFunction | string; + bodyCssClassName?: BodyCssClassNameFunction | string; } export interface GriddleProps { - columns?: string[]; - columnMetadata?: ColumnMetaData[]; - rowMetadata?: RowMetaData; - results?: T[]; - resultsPerPage?: number; - initialSort?: string; - initialSortAscending?: boolean; - gridClassName?: string; - tableClassName?: string; - customFormatClassName?: string; - settingsText?: string; - filterPlaceholderText?: string; - nextText?: string; - previousText?: string; - maxRowsText?: string; - enableCustomFormatText?: string; - childrenColumnName?: string; - metadataColumns?: string[]; - showFilter?: boolean; - showSettings?: boolean; - useCustomRowComponent?: boolean; - useCustomGridComponent?: boolean; - useCustomPagerComponent?: boolean; - useGriddleStyles?: boolean; - customRowComponent?: any; //TODO: should be React.Component, but getting weird error. - customGridComponent?: any; //TODO: should be React.Component, but getting weird error. - customPagerComponent?: any; //TODO: should be React.Component, but getting weird error. - enableToggleCustom?: boolean; - noDataMessage?: string; - noDataClassName?: string; - customNoDataComponent?: any; //TODO: should be React.Component, but getting weird error. - showTableHeading?: boolean; - showPager?: boolean; - useFixedHeader?: boolean; - useExternal?: boolean; - externalSetPage?(index: number): void; - externalChangeSort?(sort: string, sortAscending: boolean): void; - externalSetFilter?(filter: string): void; - externalSetPageSize?(size: number): void; - externalMaxPage?: number; - externalCurrentPage?: number; - externalSortColumn?: string; - externalSortAscending?: boolean; - externalLoadingComponent?: any; //TODO: should be React.Component, but getting weird error. - externalIsLoading?: boolean; - enableInfiniteScroll?: boolean; - bodyHeight?: number; - paddingHeight?: number; - rowHeight?: number; - infiniteScrollLoadTreshold?: number; - useFixedLayout?: boolean; - isSubGriddle?: boolean; - enableSort?: boolean; - sortAscendingClassName?: string; - sortDescendingClassName?: string; - parentRowCollapsedClassName?: string; - parentRowExpandedClassName?: string; - settingsToggleClassName?: string; - nextClassName?: string; - previousClassName?: string; - sortAscendingComponent?: string | React.ReactElement; - sortDescendingComponent?: string | React.ReactElement; - sortDefaultComponent?: string | React.ReactElement; - parentRowCollapsedComponent?: string | React.ReactElement; - parentRowExpandedComponent?: string | React.ReactElement; - settingsIconComponent?: string | React.ReactElement; - nextIconComponent?: string | React.ReactElement; - previousIconComponent?: string | React.ReactElement; - onRowClick?(): void; + columns?: string[]; + columnMetadata?: ColumnMetaData[]; + rowMetadata?: RowMetaData; + results?: T[]; + resultsPerPage?: number; + initialSort?: string; + initialSortAscending?: boolean; + gridClassName?: string; + tableClassName?: string; + customFormatClassName?: string; + settingsText?: string; + filterPlaceholderText?: string; + nextText?: string; + previousText?: string; + maxRowsText?: string; + enableCustomFormatText?: string; + childrenColumnName?: string; + metadataColumns?: string[]; + showFilter?: boolean; + showSettings?: boolean; + useCustomRowComponent?: boolean; + useCustomGridComponent?: boolean; + useCustomPagerComponent?: boolean; + useGriddleStyles?: boolean; + customRowComponent?: ReactClass> + customGridComponent?: ReactClass> + customPagerComponent?: ReactClass + enableToggleCustom?: boolean; + noDataMessage?: string; + noDataClassName?: string; + customNoDataComponent?: ReactClass + showTableHeading?: boolean; + showPager?: boolean; + useFixedHeader?: boolean; + useExternal?: boolean; + externalSetPage?(index: number): void; + externalChangeSort?(sort: string, sortAscending: boolean): void; + externalSetFilter?(filter: string): void; + externalSetPageSize?(size: number): void; + externalMaxPage?: number; + externalCurrentPage?: number; + externalSortColumn?: string; + externalSortAscending?: boolean; + externalLoadingComponent?: ReactClass + externalIsLoading?: boolean; + enableInfiniteScroll?: boolean; + bodyHeight?: number; + paddingHeight?: number; + rowHeight?: number; + infiniteScrollLoadTreshold?: number; + useFixedLayout?: boolean; + isSubGriddle?: boolean; + enableSort?: boolean; + sortAscendingClassName?: string; + sortDescendingClassName?: string; + parentRowCollapsedClassName?: string; + parentRowExpandedClassName?: string; + settingsToggleClassName?: string; + nextClassName?: string; + previousClassName?: string; + sortAscendingComponent?: string | React.ReactElement; + sortDescendingComponent?: string | React.ReactElement; + sortDefaultComponent?: string | React.ReactElement; + parentRowCollapsedComponent?: string | React.ReactElement; + parentRowExpandedComponent?: string | React.ReactElement; + settingsIconComponent?: string | React.ReactElement; + nextIconComponent?: string | React.ReactElement; + previousIconComponent?: string | React.ReactElement; + onRowClick?(): void; } -declare class Griddle extends React.Component, any> {} +declare class Griddle extends React.Component, any> { +} export default Griddle; \ No newline at end of file diff --git a/griddle-react/test/test.tsx b/griddle-react/test/test.tsx index 965e70018f..9888658f8d 100644 --- a/griddle-react/test/test.tsx +++ b/griddle-react/test/test.tsx @@ -1,66 +1,63 @@ import * as React from 'react'; -import {render} from 'react-dom'; -import {default as Griddle, CustomColumnComponentProps} from 'griddle-react'; - -class TestComponent extends React.Component { - render() { - return ( -
- ); - } -} +import { render } from 'react-dom'; +import Griddle, { CustomColumnComponentProps } from 'griddle-react'; interface MyCustomResult { - name: string, - test: string + name: string, + test: string } class LinkComponent extends React.Component, any> { - render() { - var url = "speakers/" + this.props.rowData.test + "/" + this.props.data; - return {this.props.data} - } + render() { + var url = "speakers/" + this.props.rowData.test + "/" + this.props.data; + return {this.props.data} + } } -var columnMeta = [ - { - columnName: "name", - order: 1, - locked: false, - visible: true, - customComponent: LinkComponent - }]; +const StatelessFunctionComponent = (props: CustomColumnComponentProps) => { + var url = "speakers/" + props.rowData.test + "/" + props.data; + return {props.data} +}; -var results = [ - { - name: 'David Hara', - test: 'blah' - }, - { - name: 'Hara, David', - test: 'blah2' - } +var columnMeta = [ + { + columnName: "name", + order: 1, + locked: false, + visible: true, + customComponent: StatelessFunctionComponent + }]; + +var results: MyCustomResult[] = [ + { + name: 'David Hara', + test: 'blah' + }, + { + name: 'Hara, David', + test: 'blah2' + } ]; var rowMetaData = { - bodyCssClassName: (rowData: MyCustomResult) => { - return rowData.test; - } + bodyCssClassName: (rowData: MyCustomResult) => { + return rowData.test; + } }; type TypedGriddle = new () => Griddle; const TypedGriddle = Griddle as TypedGriddle; render( -
- } - sortDescendingComponent={} - customRowComponent={LinkComponent} - /> -
, - document.getElementById('root') +
+ } + sortDescendingComponent={} + customRowComponent={LinkComponent} + /> +
, + document.getElementById('root') ); \ No newline at end of file From 29d2af456a3dc0cfdf35f3f020766e33e683b21d Mon Sep 17 00:00:00 2001 From: David Hara Date: Mon, 14 Mar 2016 23:21:15 -0700 Subject: [PATCH 09/81] Fixing tests. --- griddle-react/package.json | 9 +++++---- griddle-react/typings.json | 6 +++--- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/griddle-react/package.json b/griddle-react/package.json index 2b0b55b62e..1e40841688 100644 --- a/griddle-react/package.json +++ b/griddle-react/package.json @@ -8,25 +8,26 @@ }, "main": "griddle-react.d.ts", "scripts": { - "test": "typings install file:$(npm root)/../griddle-react.d.ts --name griddle-react && tsc", + "pretest": "typings install && typings install file:$(npm root)/../griddle-react.d.ts --name griddle-react", + "test": "tsc", "server": "webpack-dev-server" }, "author": "", "license": "MIT", "dependencies": { - "griddle-react": "^0.3.1", + "griddle-react": "^0.4.0", "react": "^0.14.7", "react-dom": "^0.14.7", "underscore": "^1.8.3" }, "devDependencies": { - "babel-core": "^6.6.4", + "babel-core": "^6.7.2", "babel-loader": "^6.2.4", "babel-preset-es2015": "^6.6.0", "babel-preset-react": "^6.5.0", "ts-loader": "^0.8.1", "typescript": "^1.8.7", - "typings": "^0.6.9", + "typings": "^0.7.9", "webpack": "^1.12.14", "webpack-dev-server": "^1.14.1" } diff --git a/griddle-react/typings.json b/griddle-react/typings.json index 83f0e8e61c..a9a8b348f4 100644 --- a/griddle-react/typings.json +++ b/griddle-react/typings.json @@ -1,8 +1,8 @@ { "name": "griddle-react", "main": "griddle-react.d.ts", - "dependencies": {}, - "ambientDependencies": { - "react": "github:DefinitelyTyped/DefinitelyTyped/react/react.d.ts#f407264835650f5f38d4bb2c515a79e7a835916b" + "ambientDevDependencies": { + "react": "registry:dt/react#0.14.0+20160302224448", + "react-dom": "registry:dt/react-dom#0.14.0+20151118193745" } } From dc6e6e3b14d93468d7a5cca9e5157551bd78841f Mon Sep 17 00:00:00 2001 From: David Hara Date: Mon, 14 Mar 2016 23:26:41 -0700 Subject: [PATCH 10/81] Update README with that sweet badge --- griddle-react/README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/griddle-react/README.md b/griddle-react/README.md index c5479bfd3b..933893a872 100644 --- a/griddle-react/README.md +++ b/griddle-react/README.md @@ -1,4 +1,6 @@ # griddle-react-typings +[![Build Status](https://travis-ci.org/hodavidhara/griddle-react-typings.svg?branch=master)](https://travis-ci.org/hodavidhara/griddle-react-typings) + Type definition for https://griddlegriddle.github.io/Griddle/ Depends upon the [ambient react type definitions](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/c2c22c3b953fe9730d4802022d5e0d18d083909e/react) (github:DefinitelyTyped/DefinitelyTyped/react/react.d.ts#f407264835650f5f38d4bb2c515a79e7a835916b) @@ -14,4 +16,4 @@ npm install npm test ``` -then open your browser to http://localhost:8080/webpack-dev-server/test/ \ No newline at end of file +then open your browser to http://localhost:8080/webpack-dev-server/test/ From 4cf2d399a5b1a627a810384e631b5cdab5b7d29a Mon Sep 17 00:00:00 2001 From: David Hara Date: Wed, 30 Mar 2016 00:16:28 -0700 Subject: [PATCH 11/81] Updating definitions to include new properties from griddle-react@0.4.x --- griddle-react/griddle-react.d.ts | 25 +++++- griddle-react/package.json | 12 +-- griddle-react/test/CustomColumnComponent.tsx | 64 ++++++++++++++ griddle-react/test/CustomFilterComponent.tsx | 85 +++++++++++++++++++ griddle-react/test/CustomHeaderComponent.tsx | 89 ++++++++++++++++++++ griddle-react/test/index.tsx | 17 ++++ griddle-react/typings.json | 1 + griddle-react/webpack.config.js | 33 ++++---- 8 files changed, 302 insertions(+), 24 deletions(-) create mode 100644 griddle-react/test/CustomColumnComponent.tsx create mode 100644 griddle-react/test/CustomFilterComponent.tsx create mode 100644 griddle-react/test/CustomHeaderComponent.tsx create mode 100644 griddle-react/test/index.tsx diff --git a/griddle-react/griddle-react.d.ts b/griddle-react/griddle-react.d.ts index a4e8a6a584..90a09c1e36 100644 --- a/griddle-react/griddle-react.d.ts +++ b/griddle-react/griddle-react.d.ts @@ -26,13 +26,28 @@ export interface CustomPagerComponentProps { setPage(number: number): void; } +export interface CustomHeaderComponentProps { + filterByColumn?(filter: string, columnName: string): void; + columnName: string; + displayName: string; +} + +export interface CustomFilterComponentProps { + placeholderText?: string; + changeFilter(val: any): void; +} + export interface ColumnMetaData { columnName: string; - order?: number; - locked?: boolean; cssClassName?: string; - displayName?: string; customComponent?: ReactClass>; + customHeaderComponent?: ReactClass; + customHeaderComponentProps?: {}; + displayName?: string; + locked?: boolean; + order?: number; + sortable?: boolean; + visible?: boolean; } export interface BodyCssClassNameFunction { @@ -67,10 +82,14 @@ export interface GriddleProps { useCustomRowComponent?: boolean; useCustomGridComponent?: boolean; useCustomPagerComponent?: boolean; + useCustomFilterer?: boolean; + useCustomFilterComponent?: boolean; useGriddleStyles?: boolean; customRowComponent?: ReactClass> customGridComponent?: ReactClass> customPagerComponent?: ReactClass + customFilterComponent?: ReactClass + customFilterer?(items: T[], query: any): T[]; enableToggleCustom?: boolean; noDataMessage?: string; noDataClassName?: string; diff --git a/griddle-react/package.json b/griddle-react/package.json index 1e40841688..ca6d23b962 100644 --- a/griddle-react/package.json +++ b/griddle-react/package.json @@ -15,18 +15,18 @@ "author": "", "license": "MIT", "dependencies": { - "griddle-react": "^0.4.0", - "react": "^0.14.7", - "react-dom": "^0.14.7", - "underscore": "^1.8.3" + "griddle-react": "^0.4.1", + "lodash": "^4.6.1", + "react": "^0.14.8", + "react-dom": "^0.14.8" }, "devDependencies": { - "babel-core": "^6.7.2", + "babel-core": "^6.7.4", "babel-loader": "^6.2.4", "babel-preset-es2015": "^6.6.0", "babel-preset-react": "^6.5.0", "ts-loader": "^0.8.1", - "typescript": "^1.8.7", + "typescript": "^1.8.9", "typings": "^0.7.9", "webpack": "^1.12.14", "webpack-dev-server": "^1.14.1" diff --git a/griddle-react/test/CustomColumnComponent.tsx b/griddle-react/test/CustomColumnComponent.tsx new file mode 100644 index 0000000000..3f9b9cd22b --- /dev/null +++ b/griddle-react/test/CustomColumnComponent.tsx @@ -0,0 +1,64 @@ +import * as React from 'react'; +import Griddle, { CustomColumnComponentProps } from 'griddle-react'; + +interface MyCustomResult { + name: string, + test: string +} + +class LinkComponent extends React.Component, any> { + render() { + var url = "speakers/" + this.props.rowData.test + "/" + this.props.data; + return {this.props.data} + } +} + +const StatelessFunctionComponent = (props: CustomColumnComponentProps) => { + var url = "speakers/" + props.rowData.test + "/" + props.data; + return {props.data} +}; + +var columnMeta = [ + { + columnName: "name", + order: 1, + locked: false, + visible: true, + customComponent: StatelessFunctionComponent + }]; + +var results: MyCustomResult[] = [ + { + name: 'David Hara', + test: 'blah' + }, + { + name: 'Hara, David', + test: 'blah2' + } +]; + +var rowMetaData = { + bodyCssClassName: (rowData: MyCustomResult) => { + return rowData.test; + } +}; + +class CustomColumnComponentGrid extends React.Component { + render() { + type TypedGriddle = new () => Griddle; + const TypedGriddle = Griddle as TypedGriddle; + + return ( + } + sortDescendingComponent={} + customRowComponent={LinkComponent} /> + ); + }; +} + +export default CustomColumnComponentGrid; \ No newline at end of file diff --git a/griddle-react/test/CustomFilterComponent.tsx b/griddle-react/test/CustomFilterComponent.tsx new file mode 100644 index 0000000000..349b132947 --- /dev/null +++ b/griddle-react/test/CustomFilterComponent.tsx @@ -0,0 +1,85 @@ +import * as _ from 'lodash'; +import * as React from 'react'; +import Griddle, { CustomFilterComponentProps } from 'griddle-react'; + +var customFilterFunction = function(items: ResultType[], query: string): ResultType[] { + return _.filter(items, (item) => { + + let match = false; + _.forIn(item, (value, key) => { + if (String(value).toLowerCase().indexOf(query.toLowerCase()) >= 0) { + match = true; + return; + } + }); + + return match; + }); +}; + +class CustomFilterComponent extends React.Component { + query: string = ''; + + searchChange(event) { + this.query = event.target.value; + this.props.changeFilter(this.query); + } + + render() { + return ( +
+ +
+ ); + } +} + +interface ResultType { + id: number; + name: string; + city: string; + state: string; + country: string; + company: string; + favoriteNumber: number; +} + +var someData: ResultType[] = [ + { + "id": 0, + "name": "Mayer Leonard", + "city": "Kapowsin", + "state": "Hawaii", + "country": "United Kingdom", + "company": "Ovolo", + "favoriteNumber": 7 + }, + { + "id": 1, + "name": "Koch Becker", + "city": "Johnsonburg", + "state": "New Jersey", + "country": "Madagascar", + "company": "Eventage", + "favoriteNumber": 2 + } +]; + +class CustomFilterComponentGrid extends React.Component { + render() { + + type TypedGriddle = new () => Griddle; + const TypedGriddle = Griddle as TypedGriddle; + + return ( + + ); + } +} + +export default CustomFilterComponentGrid; \ No newline at end of file diff --git a/griddle-react/test/CustomHeaderComponent.tsx b/griddle-react/test/CustomHeaderComponent.tsx new file mode 100644 index 0000000000..0d59405c5a --- /dev/null +++ b/griddle-react/test/CustomHeaderComponent.tsx @@ -0,0 +1,89 @@ +import * as React from 'react'; +import Griddle, { ColumnMetaData, CustomHeaderComponentProps } from 'griddle-react'; + +interface MoreCustomHeaderComponentProps extends CustomHeaderComponentProps { + color: string; +} + +class HeaderComponent extends React.Component { + textOnClick(e) { + e.stopPropagation(); + } + + filterText(e) { + this.props.filterByColumn(e.target.value, this.props.columnName) + } + + render() { + return ( + +
{this.props.displayName}
+ +
+ ); + } +} + +interface ResultType { + id: number; + name: string; + city: string; + state: string; + country: string; + company: string; + favoriteNumber: number; +} + +var someData: ResultType[] = [ + { + "id": 0, + "name": "Mayer Leonard", + "city": "Kapowsin", + "state": "Hawaii", + "country": "United Kingdom", + "company": "Ovolo", + "favoriteNumber": 7 + }, + { + "id": 1, + "name": "Koch Becker", + "city": "Johnsonburg", + "state": "New Jersey", + "country": "Madagascar", + "company": "Eventage", + "favoriteNumber": 2 + } +]; + +var columnMeta: ColumnMetaData[] = [ + { + columnName: 'name', + order: 1, + sortable: false, + visible: true, + }, + { + columnName: 'city', + customHeaderComponent: HeaderComponent, + customHeaderComponentProps: {color: 'red'} + }, + { + columnName: 'state', + customHeaderComponent: HeaderComponent, + customHeaderComponentProps: {color: 'blue'} + } +]; + +class CustomHeaderComponentGrid extends React.Component { + render() { + + type TypedGriddle = new () => Griddle; + const TypedGriddle = Griddle as TypedGriddle; + + return ( + + ); + } +} + +export default CustomHeaderComponentGrid; \ No newline at end of file diff --git a/griddle-react/test/index.tsx b/griddle-react/test/index.tsx new file mode 100644 index 0000000000..8883029708 --- /dev/null +++ b/griddle-react/test/index.tsx @@ -0,0 +1,17 @@ +import * as React from 'react'; +import { render } from 'react-dom'; +import CustomColumnComponentGrid from './CustomColumnComponent'; +import CustomHeaderComponentGrid from './CustomHeaderComponent'; +import CustomFilterComponentGrid from './CustomFilterComponent'; + +render( +
+

Custom Column Component Grid

+ +

Custom Header Component Grid

+ +

Custom Filter Component Grid

+ +
, + document.getElementById('root') +); \ No newline at end of file diff --git a/griddle-react/typings.json b/griddle-react/typings.json index a9a8b348f4..82b06e474c 100644 --- a/griddle-react/typings.json +++ b/griddle-react/typings.json @@ -2,6 +2,7 @@ "name": "griddle-react", "main": "griddle-react.d.ts", "ambientDevDependencies": { + "lodash": "registry:dt/lodash#3.10.0+20160327004937", "react": "registry:dt/react#0.14.0+20160302224448", "react-dom": "registry:dt/react-dom#0.14.0+20151118193745" } diff --git a/griddle-react/webpack.config.js b/griddle-react/webpack.config.js index f2f79ea1e4..56d9405a77 100644 --- a/griddle-react/webpack.config.js +++ b/griddle-react/webpack.config.js @@ -1,17 +1,20 @@ module.exports = { - entry: ['./test/test.tsx'], - output: { - path: '/', - filename: 'bundle.js' - }, - module: { - loaders: [ - { - test: /.tsx?$/, - loaders: ['babel-loader', 'ts-loader'], - exclude: /node_modules/ - } - ] - }, - devtool: "#source-map" + entry: ['./test/index.tsx'], + resolve: { + extensions: ["", ".webpack.js", ".web.js", ".js", ".ts", ".tsx"] + }, + output: { + path: '/', + filename: 'bundle.js' + }, + module: { + loaders: [ + { + test: /.tsx?$/, + loaders: ['babel-loader', 'ts-loader'], + exclude: /node_modules/ + } + ] + }, + devtool: "#source-map" }; \ No newline at end of file From e69ec0854f30089593217fb4293b77f46e9b1f51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ant=C3=A9rio=20vieira=20da=20silva?= Date: Sun, 5 Feb 2017 14:26:09 -0200 Subject: [PATCH 12/81] Add type definitions for angular-oauth2 --- angular-oauth2/angular-oauth2-tests.ts | 10 +++++ angular-oauth2/index.d.ts | 51 ++++++++++++++++++++++++++ angular-oauth2/tsconfig.json | 20 ++++++++++ angular-oauth2/tslint.json | 1 + 4 files changed, 82 insertions(+) create mode 100644 angular-oauth2/angular-oauth2-tests.ts create mode 100644 angular-oauth2/index.d.ts create mode 100644 angular-oauth2/tsconfig.json create mode 100644 angular-oauth2/tslint.json diff --git a/angular-oauth2/angular-oauth2-tests.ts b/angular-oauth2/angular-oauth2-tests.ts new file mode 100644 index 0000000000..7ccf634745 --- /dev/null +++ b/angular-oauth2/angular-oauth2-tests.ts @@ -0,0 +1,10 @@ +import * as angular from 'angular'; + +angular.module('angular-oauth2-test', ['angular-oauth2']) + .config(['OAuthProvider', function(OAuthProvider:angular.oauth2.IOAuthProvider){ + OAuthProvider.configure({ + baseUrl: 'https://api.website.com', + clientId: 'CLIENT_ID', + clientSecret: 'CLIENT_SECRET' // optional + }); + }]); \ No newline at end of file diff --git a/angular-oauth2/index.d.ts b/angular-oauth2/index.d.ts new file mode 100644 index 0000000000..1ea4bbdd67 --- /dev/null +++ b/angular-oauth2/index.d.ts @@ -0,0 +1,51 @@ +// Type definitions for angular-oauth2 4.1 +// Project: https://github.com/seegno/angular-oauth2 +// Definitions by: Antério Vieira +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +import * as angular from 'angular'; + +declare module 'angular' { + + export namespace oauth2 { + + interface IOAuthConfig { + baseUrl: string; + clientId: string; + clientSecret?: string; + grantPath?: string; + revokePath?: string; + } + + interface IOAuthProvider { + configure(params: IOAuthConfig): IOAuthConfig; + } + + interface IData { + username: string; + password: string; + } + + interface IOAuth { + isAuthenticated(): boolean; + getAccessToken(data: IData, options?: any): angular.IPromise; + getRefreshToken(data?: IData, options?: any): angular.IPromise; + revokeToken(data?: IData, options?: any): angular.IPromise; + } + + interface IOAuthTokenConfig { + name: string; + options: any; + } + + interface IOAuthTokenOptions { + secure: boolean; + } + + interface IOAuthTokenProvider { + configure(params: IOAuthTokenConfig): IOAuthTokenConfig; + } + + } +} + diff --git a/angular-oauth2/tsconfig.json b/angular-oauth2/tsconfig.json new file mode 100644 index 0000000000..717721bf79 --- /dev/null +++ b/angular-oauth2/tsconfig.json @@ -0,0 +1,20 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "angular-oauth2-tests.ts" + ] +} diff --git a/angular-oauth2/tslint.json b/angular-oauth2/tslint.json new file mode 100644 index 0000000000..377cc837d4 --- /dev/null +++ b/angular-oauth2/tslint.json @@ -0,0 +1 @@ +{ "extends": "../tslint.json" } From 338730ccd91c2487325df803c8e9350f5c397622 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ant=C3=A9rio=20vieira=20da=20silva?= Date: Sun, 5 Feb 2017 22:50:04 -0200 Subject: [PATCH 13/81] Updated interface name --- angular-oauth2/angular-oauth2-tests.ts | 2 +- angular-oauth2/index.d.ts | 28 ++++++++++++-------------- 2 files changed, 14 insertions(+), 16 deletions(-) diff --git a/angular-oauth2/angular-oauth2-tests.ts b/angular-oauth2/angular-oauth2-tests.ts index 7ccf634745..2b2328d5ee 100644 --- a/angular-oauth2/angular-oauth2-tests.ts +++ b/angular-oauth2/angular-oauth2-tests.ts @@ -1,7 +1,7 @@ import * as angular from 'angular'; angular.module('angular-oauth2-test', ['angular-oauth2']) - .config(['OAuthProvider', function(OAuthProvider:angular.oauth2.IOAuthProvider){ + .config(['OAuthProvider', function(OAuthProvider:angular.oauth2.OAuthProvider){ OAuthProvider.configure({ baseUrl: 'https://api.website.com', clientId: 'CLIENT_ID', diff --git a/angular-oauth2/index.d.ts b/angular-oauth2/index.d.ts index 1ea4bbdd67..35af0fe155 100644 --- a/angular-oauth2/index.d.ts +++ b/angular-oauth2/index.d.ts @@ -6,10 +6,8 @@ import * as angular from 'angular'; declare module 'angular' { - - export namespace oauth2 { - - interface IOAuthConfig { + export namespace oauth2 { + interface OAuthConfig { baseUrl: string; clientId: string; clientSecret?: string; @@ -17,33 +15,33 @@ declare module 'angular' { revokePath?: string; } - interface IOAuthProvider { - configure(params: IOAuthConfig): IOAuthConfig; + interface OAuthProvider { + configure(params: OAuthConfig): OAuthConfig; } - interface IData { + interface Data { username: string; password: string; } - interface IOAuth { + interface OAuth { isAuthenticated(): boolean; - getAccessToken(data: IData, options?: any): angular.IPromise; - getRefreshToken(data?: IData, options?: any): angular.IPromise; - revokeToken(data?: IData, options?: any): angular.IPromise; + getAccessToken(data: Data, options?: any): angular.IPromise; + getRefreshToken(data?: Data, options?: any): angular.IPromise; + revokeToken(data?: Data, options?: any): angular.IPromise; } - interface IOAuthTokenConfig { + interface OAuthTokenConfig { name: string; options: any; } - interface IOAuthTokenOptions { + interface OAuthTokenOptions { secure: boolean; } - interface IOAuthTokenProvider { - configure(params: IOAuthTokenConfig): IOAuthTokenConfig; + interface OAuthTokenProvider { + configure(params: OAuthTokenConfig): OAuthTokenConfig; } } From f3e5bce4305292a189e36100fcd7411cd218b4ac Mon Sep 17 00:00:00 2001 From: Kou Matsumoto Date: Mon, 6 Feb 2017 11:23:44 +0900 Subject: [PATCH 14/81] add promiseLibrary property to ConnectionOpenSetOptions interface --- mongoose/index.d.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mongoose/index.d.ts b/mongoose/index.d.ts index 56ad48e617..8ba2405640 100644 --- a/mongoose/index.d.ts +++ b/mongoose/index.d.ts @@ -383,6 +383,9 @@ declare module "mongoose" { * If connecting to multiple mongos servers, set the mongos option to true. */ mongos?: boolean; + + /** sets the underlying driver's promise library (see http://mongodb.github.io/node-mongodb-native/2.1/api/MongoClient.html) */ + promiseLibrary?: any; } interface ConnectionOptions extends From 4a6df91d35dc85cc2b293869113eb6e9e26e72f8 Mon Sep 17 00:00:00 2001 From: Keith Dahlby Date: Tue, 7 Feb 2017 15:03:55 -0600 Subject: [PATCH 15/81] Fix output location --- griddle-react/.gitignore | 2 ++ griddle-react/webpack.config.js | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/griddle-react/.gitignore b/griddle-react/.gitignore index 073b01eae5..0a7b2a3260 100644 --- a/griddle-react/.gitignore +++ b/griddle-react/.gitignore @@ -3,6 +3,8 @@ /target /typings +output/ + # Logs logs *.log diff --git a/griddle-react/webpack.config.js b/griddle-react/webpack.config.js index 56d9405a77..03320a27b5 100644 --- a/griddle-react/webpack.config.js +++ b/griddle-react/webpack.config.js @@ -4,7 +4,7 @@ module.exports = { extensions: ["", ".webpack.js", ".web.js", ".js", ".ts", ".tsx"] }, output: { - path: '/', + path: './output/', filename: 'bundle.js' }, module: { From d7bdb14994e32d18afd20f86179c9000a7e2a5a3 Mon Sep 17 00:00:00 2001 From: Keith Dahlby Date: Thu, 9 Feb 2017 12:01:31 -0600 Subject: [PATCH 16/81] Bump TS, Griddle, React, Lodash versions Pinning to TS 2.1 due to: https://github.com/DefinitelyTyped/DefinitelyTyped/pull/14502 Versions are otherwise aligned with Griddle 0.7.1: https://github.com/GriddleGriddle/Griddle/blob/d8f7ee8a8474530b456d9a973a5db743cfb2a9ff/package.json --- griddle-react/package.json | 22 +++++++++++++++------- griddle-react/typings.json | 7 +------ 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/griddle-react/package.json b/griddle-react/package.json index ca6d23b962..349be9ec89 100644 --- a/griddle-react/package.json +++ b/griddle-react/package.json @@ -1,6 +1,6 @@ { "name": "griddle-react-typings", - "version": "1.0.0", + "version": "0.7.1", "description": "", "repository": { "type": "git", @@ -8,25 +8,33 @@ }, "main": "griddle-react.d.ts", "scripts": { - "pretest": "typings install && typings install file:$(npm root)/../griddle-react.d.ts --name griddle-react", "test": "tsc", "server": "webpack-dev-server" }, "author": "", "license": "MIT", + "peerDependencies": { + "@types/react": "^0.14.3 || ^15.0.1", + "@types/react-dom": "^0.14.3 || ^15.0.1", + "react": "^0.14.3 || ^15.0.1", + "react-dom": "^0.14.3 || ^15.0.1" + }, "dependencies": { - "griddle-react": "^0.4.1", - "lodash": "^4.6.1", - "react": "^0.14.8", - "react-dom": "^0.14.8" + "@types/lodash": "^4.12.0", + "griddle-react": "^0.7.1", + "lodash": "^4.12.0" }, "devDependencies": { + "@types/react": "^0.14.3 || ^15.0.1", + "@types/react-dom": "^0.14.3 || ^15.0.1", "babel-core": "^6.7.4", "babel-loader": "^6.2.4", "babel-preset-es2015": "^6.6.0", "babel-preset-react": "^6.5.0", + "react": "^0.14.3 || ^15.0.1", + "react-dom": "^0.14.3 || ^15.0.1", "ts-loader": "^0.8.1", - "typescript": "^1.8.9", + "typescript": "^2.1.0", "typings": "^0.7.9", "webpack": "^1.12.14", "webpack-dev-server": "^1.14.1" diff --git a/griddle-react/typings.json b/griddle-react/typings.json index 82b06e474c..b7346e0ead 100644 --- a/griddle-react/typings.json +++ b/griddle-react/typings.json @@ -1,9 +1,4 @@ { "name": "griddle-react", - "main": "griddle-react.d.ts", - "ambientDevDependencies": { - "lodash": "registry:dt/lodash#3.10.0+20160327004937", - "react": "registry:dt/react#0.14.0+20160302224448", - "react-dom": "registry:dt/react-dom#0.14.0+20151118193745" - } + "main": "griddle-react.d.ts" } From bf262f122eeecf6480ca4f1f85aa4b1e5cf0da62 Mon Sep 17 00:00:00 2001 From: Keith Dahlby Date: Thu, 9 Feb 2017 12:28:10 -0600 Subject: [PATCH 17/81] Update README --- griddle-react/README.md | 9 ++------- griddle-react/package.json | 2 +- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/griddle-react/README.md b/griddle-react/README.md index 933893a872..25169cfd6d 100644 --- a/griddle-react/README.md +++ b/griddle-react/README.md @@ -1,19 +1,14 @@ # griddle-react-typings [![Build Status](https://travis-ci.org/hodavidhara/griddle-react-typings.svg?branch=master)](https://travis-ci.org/hodavidhara/griddle-react-typings) -Type definition for https://griddlegriddle.github.io/Griddle/ +Typescript 2.1 definition for https://griddlegriddle.github.io/Griddle/ -Depends upon the [ambient react type definitions](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/c2c22c3b953fe9730d4802022d5e0d18d083909e/react) (github:DefinitelyTyped/DefinitelyTyped/react/react.d.ts#f407264835650f5f38d4bb2c515a79e7a835916b) -which you can install with: - -``` -typings install react --ambient -``` ## Testing run: ``` npm install npm test +npm start ``` then open your browser to http://localhost:8080/webpack-dev-server/test/ diff --git a/griddle-react/package.json b/griddle-react/package.json index 349be9ec89..167b423124 100644 --- a/griddle-react/package.json +++ b/griddle-react/package.json @@ -9,7 +9,7 @@ "main": "griddle-react.d.ts", "scripts": { "test": "tsc", - "server": "webpack-dev-server" + "start": "webpack-dev-server" }, "author": "", "license": "MIT", From 6c8dd6bae317d94dedf44b80945b5e73bc361170 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ant=C3=A9rio=20Vieira?= Date: Fri, 10 Feb 2017 08:11:30 -0200 Subject: [PATCH 18/81] Project link updated --- angular-oauth2/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/angular-oauth2/index.d.ts b/angular-oauth2/index.d.ts index 35af0fe155..e6b9592874 100644 --- a/angular-oauth2/index.d.ts +++ b/angular-oauth2/index.d.ts @@ -1,5 +1,5 @@ // Type definitions for angular-oauth2 4.1 -// Project: https://github.com/seegno/angular-oauth2 +// Project: https://github.com/oauthjs/angular-oauth2 // Definitions by: Antério Vieira // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped From f390a5993680068fddd5be81af1738a05c3018b8 Mon Sep 17 00:00:00 2001 From: Jonathan Jayet Date: Fri, 10 Feb 2017 11:21:20 +0100 Subject: [PATCH 19/81] Added missing options to Joi.string().guid() --- joi/index.d.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/joi/index.d.ts b/joi/index.d.ts index 55e6b9c75f..bd78997932 100644 --- a/joi/index.d.ts +++ b/joi/index.d.ts @@ -91,6 +91,12 @@ export interface IpOptions { cidr?: string; } +export type GuidVersions = 'uuidv1' | 'uuidv2' | 'uuidv3' | 'uuidv4' | 'uuidv5' + +export interface GuidOptions { + version: GuidVersions[] +} + export interface UriOptions { /** * Specifies one or more acceptable Schemes, should only include the scheme name. @@ -443,7 +449,7 @@ export interface StringSchema extends AnySchema { /** * Requires the string value to be a valid GUID. */ - guid(): StringSchema; + guid(options?: GuidOptions): StringSchema; /** * Requires the string value to be a valid hexadecimal string. From 303462459eb3911762125bbc2f41b6991ceb04b4 Mon Sep 17 00:00:00 2001 From: Ivo Murrell Date: Fri, 10 Feb 2017 16:48:45 +0000 Subject: [PATCH 20/81] Make TextGeometryParameters options optional. --- three/index.d.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/three/index.d.ts b/three/index.d.ts index 100e3ecf8c..97cccb6c4b 100644 --- a/three/index.d.ts +++ b/three/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for three.js 0.83 // Project: http://mrdoob.github.com/three.js/ -// Definitions by: Kon , Satoru Kimura , Florent Poujol , SereznoKot , HouChunlei +// Definitions by: Kon , Satoru Kimura , Florent Poujol , SereznoKot , HouChunlei , Ivo // Definitions: https://github.com/borisyankov/DefinitelyTyped /// @@ -6415,13 +6415,13 @@ declare namespace THREE { } export interface TextGeometryParameters { - font: Font; - size: number; - height: number; - curveSegments: number; - bevelEnabled: boolean; - bevelThickness: number; - bevelSize: number; + font?: Font; + size?: number; + height?: number; + curveSegments?: number; + bevelEnabled?: boolean; + bevelThickness?: number; + bevelSize?: number; } export class TextGeometry extends ExtrudeGeometry { From f757913724f7f85b4c12b7cc183ac2e30ce20cf7 Mon Sep 17 00:00:00 2001 From: Chase Cummings Date: Fri, 10 Feb 2017 12:10:20 -0800 Subject: [PATCH 21/81] dockerode: Added State field to ContainerInfo object --- dockerode/index.d.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dockerode/index.d.ts b/dockerode/index.d.ts index 2c5caaf9cc..b884339d33 100644 --- a/dockerode/index.d.ts +++ b/dockerode/index.d.ts @@ -184,6 +184,7 @@ declare namespace Dockerode { Created: number; Ports: Port[]; Labels: { [label: string]: string }; + State: string; Status: string; HostConfig: { NetworkMode: string; @@ -640,4 +641,4 @@ declare class Dockerode { modem: any; } -export = Dockerode; \ No newline at end of file +export = Dockerode; From 6ddb418192acdbffb65238f6969870aa8d8143b6 Mon Sep 17 00:00:00 2001 From: Liwen Guo Date: Sat, 11 Feb 2017 02:18:51 +0100 Subject: [PATCH 22/81] [request] add body property to RequestResponse --- request/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/request/index.d.ts b/request/index.d.ts index edf31b9a9b..5e5dfb55a3 100644 --- a/request/index.d.ts +++ b/request/index.d.ts @@ -143,6 +143,7 @@ declare namespace request { export interface RequestResponse extends http.IncomingMessage { request: Options; + body: any; } export interface HttpArchiveRequest { From 9e6bb6dc848ae48473036b91ee90c16b15fd4271 Mon Sep 17 00:00:00 2001 From: Chase Cummings Date: Fri, 10 Feb 2017 18:13:39 -0800 Subject: [PATCH 23/81] dockerode: Removed newline From 7f7b9dfddcb0dbe0285699bf8b3caaa2c0981b0a Mon Sep 17 00:00:00 2001 From: Omer Bokhari Date: Fri, 10 Feb 2017 22:48:48 -0800 Subject: [PATCH 24/81] Add missing asyncValidate argument --- redux-form/lib/reduxForm.d.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/redux-form/lib/reduxForm.d.ts b/redux-form/lib/reduxForm.d.ts index 512797a39c..dc13fa9a9b 100644 --- a/redux-form/lib/reduxForm.d.ts +++ b/redux-form/lib/reduxForm.d.ts @@ -48,14 +48,14 @@ export interface Config { asyncBlurFields?: string[]; /** - * a function that takes all the form values, the dispatch function, and - * the props given to your component, and returns a Promise that will - * resolve if the validation is passed, or will reject with an object of - * validation errors in the form { field1: , field2: }. + * a function that takes all the form values, the dispatch function, + * the props given to your component and the current blurred field, + * and returns a Promise that will resolve if the validation is passed, + * or will reject with an object of validation errors in the form { field1: , field2: }. * * See Asynchronous Blur Validation Example for more details. */ - asyncValidate?(values: FormData, dispatch: Dispatch, props: P): Promise; + asyncValidate?(values: FormData, dispatch: Dispatch, props: P, blurredField: string): Promise; /** * Whether or not to automatically destroy your form's state in the Redux From 324faf6289ab3f86e0d06740c7a4b4539f79ac3c Mon Sep 17 00:00:00 2001 From: Omer Bokhari Date: Fri, 10 Feb 2017 23:24:23 -0800 Subject: [PATCH 25/81] Increase version number in header from 6.3.1 to 6.3.3, since 6.3.2 is the currently published version --- redux-form/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/redux-form/index.d.ts b/redux-form/index.d.ts index 590fe3a633..b5b2d60de4 100644 --- a/redux-form/index.d.ts +++ b/redux-form/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for redux-form v6.3.1 +// Type definitions for redux-form v6.3.3 // Project: https://github.com/erikras/redux-form // Definitions by: Carson Full , Daniel Lytkin // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped From 2ef80bcc931b65291fec0f6aaf8fbcdfa8ed8cfe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomek=20=C5=81aziuk?= Date: Sat, 11 Feb 2017 10:32:58 +0100 Subject: [PATCH 26/81] combined-stream --- combined-stream/combined-stream-tests.ts | 30 +++++++++++++ combined-stream/index.d.ts | 56 ++++++++++++++++++++++++ combined-stream/tsconfig.json | 20 +++++++++ combined-stream/tslint.json | 1 + 4 files changed, 107 insertions(+) create mode 100644 combined-stream/combined-stream-tests.ts create mode 100644 combined-stream/index.d.ts create mode 100644 combined-stream/tsconfig.json create mode 100644 combined-stream/tslint.json diff --git a/combined-stream/combined-stream-tests.ts b/combined-stream/combined-stream-tests.ts new file mode 100644 index 0000000000..776e530e63 --- /dev/null +++ b/combined-stream/combined-stream-tests.ts @@ -0,0 +1,30 @@ +import * as CombinedStream from "combined-stream"; +import { createReadStream, createWriteStream } from "fs"; + +const stream1 = new CombinedStream(); + +stream1.append(createReadStream("tsconfig.json")); +stream1.append(createReadStream("tslint.json")); +stream1.append(createReadStream("index.d.ts")); + +stream1.pipe(createWriteStream("combined.txt")); + +const stream2 = CombinedStream.create({ + maxDataSize: 1 << 32, + pauseStreams: false, +}); + +stream1.destroy(); + +// should log true +console.log(CombinedStream.isStreamLike(stream2)); + +stream2.on("data", (data) => { + console.log(data); +}); + +stream2.pipe(createWriteStream("combined.txt")); + +stream2.write(CombinedStream.name); + +stream2.destroy(); diff --git a/combined-stream/index.d.ts b/combined-stream/index.d.ts new file mode 100644 index 0000000000..cada758701 --- /dev/null +++ b/combined-stream/index.d.ts @@ -0,0 +1,56 @@ +// Type definitions for combined-stream 1.0 +// Project: https://github.com/felixge/node-combined-stream +// Definitions by: Felix Geisendörfer , Tomek Łaziuk +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +import { Stream } from "stream"; + +declare class CombinedStream extends Stream implements CombinedStream.Options { + readonly writable: boolean; + readonly readable: boolean; + readonly dataSize: number; + maxDataSize: number; + pauseStreams: boolean; + append(stream: NodeJS.ReadableStream | NodeJS.WritableStream | Buffer | string): this; + write(data: any): void; + pause(): void; + resume(): void; + end(): void; + destroy(): void; + + // private properties + _released: boolean; + // @TODO it should be a type of Array<'delayed-stream' instance | Buffer | string> + _streams: Array; + _currentStream: Stream | Buffer | string | null; + _getNext(): void; + _pipeNext(): void; + _handleErrors(stream: NodeJS.EventEmitter): void; + _reset(): void; + _checkDataSize(): void; + _updateDataSize(): void; + _emitError(error: Error): void; + + // events + on(event: "close" | "end" | "resume" | "pause", cb: () => void): this; + on(event: "error", cb: (err: Error) => void): this; + on(event: "data", cb: (data: any) => void): this; + once(event: "close" | "end" | "resume" | "pause", cb: () => void): this; + once(event: "error", cb: (err: Error) => void): this; + once(event: "data", cb: (data: any) => void): this; +} + +declare namespace CombinedStream { + export interface Options { + maxDataSize?: number; + pauseStreams?: boolean; + } + + export function create(options?: Options): CombinedStream; + + export function isStreamLike(stream: any): stream is Stream; +} + +export = CombinedStream; diff --git a/combined-stream/tsconfig.json b/combined-stream/tsconfig.json new file mode 100644 index 0000000000..5ffd68770c --- /dev/null +++ b/combined-stream/tsconfig.json @@ -0,0 +1,20 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "combined-stream-tests.ts" + ] +} diff --git a/combined-stream/tslint.json b/combined-stream/tslint.json new file mode 100644 index 0000000000..377cc837d4 --- /dev/null +++ b/combined-stream/tslint.json @@ -0,0 +1 @@ +{ "extends": "../tslint.json" } From 8ccf4f11564f7ab21882f7224adf407718249e74 Mon Sep 17 00:00:00 2001 From: Jonathan Jayet Date: Sat, 11 Feb 2017 11:59:55 +0100 Subject: [PATCH 27/81] Fixed missing option + added tests --- joi/index.d.ts | 2 +- joi/joi-tests.ts | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/joi/index.d.ts b/joi/index.d.ts index bd78997932..fe1f0e39f8 100644 --- a/joi/index.d.ts +++ b/joi/index.d.ts @@ -94,7 +94,7 @@ export interface IpOptions { export type GuidVersions = 'uuidv1' | 'uuidv2' | 'uuidv3' | 'uuidv4' | 'uuidv5' export interface GuidOptions { - version: GuidVersions[] + version: GuidVersions[] | GuidVersions } export interface UriOptions { diff --git a/joi/joi-tests.ts b/joi/joi-tests.ts index 59eb446b2f..3a222ff832 100644 --- a/joi/joi-tests.ts +++ b/joi/joi-tests.ts @@ -691,6 +691,8 @@ strSchema = strSchema.ip(ipOpts); strSchema = strSchema.uri(); strSchema = strSchema.uri(uriOpts); strSchema = strSchema.guid(); +strSchema = strSchema.guid({version: ['uuidv1', 'uuidv2', 'uuidv3', 'uuidv4', 'uuidv5']}); +strSchema = strSchema.guid({version: 'uuidv4'}); strSchema = strSchema.hex(); strSchema = strSchema.hostname(); strSchema = strSchema.isoDate(); From 7cbd7c97e1d3e6b449a6bfa4d3f61a5447058b9a Mon Sep 17 00:00:00 2001 From: Dan Marshall Date: Sat, 11 Feb 2017 14:26:07 -0800 Subject: [PATCH 28/81] update to maker.js 0.9.33 --- maker.js/index.d.ts | 115 +++++++++++++++++++++++++++++++------ maker.js/maker.js-tests.ts | 10 ++++ 2 files changed, 109 insertions(+), 16 deletions(-) diff --git a/maker.js/index.d.ts b/maker.js/index.d.ts index ad06d7eb91..ff6a7bd69e 100644 --- a/maker.js/index.d.ts +++ b/maker.js/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Maker.js 0.9.31 +// Type definitions for Maker.js 0.9.33 // Project: https://github.com/Microsoft/maker.js // Definitions by: Dan Marshall // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -66,6 +66,17 @@ declare namespace MakerJs { * @returns String of the flattened array. */ function createRouteKey(route: string[]): string; + /** + * Travel along a route inside of a model to extract a specific node in its tree. + * + * @param modelContext Model to travel within. + * @param routeKeyOrRoute String of a flattened route, or a string array of route segments. + * @returns Model or Path object within the modelContext tree. + */ + function travel(modelContext: IModel, routeKeyOrRoute: string | string[]): { + path: IPath | IModel; + offset: IPoint; + }; /** * Clone an object. * @@ -139,6 +150,15 @@ declare namespace MakerJs { */ high: IPoint; } + /** + * A measurement of extents, with a center point. + */ + interface IMeasureWithCenter extends IMeasure { + /** + * The center point of the rectangle containing the item being measured. + */ + center: IPoint; + } /** * A map of measurements. */ @@ -926,7 +946,7 @@ declare namespace MakerJs.path { * * @param pathToMove The path to move. * @param origin The new origin for the path. - * @returns The original path (for chaining). + * @returns The original path (for cascading). */ function move(pathToMove: IPath, origin: IPoint): IPath; /** @@ -935,7 +955,7 @@ declare namespace MakerJs.path { * @param pathToMove The path to move. * @param delta The x & y adjustments as a point object. * @param subtract Optional boolean to subtract instead of add. - * @returns The original path (for chaining). + * @returns The original path (for cascading). */ function moveRelative(pathToMove: IPath, delta: IPoint, subtract?: boolean): IPath; /** @@ -952,7 +972,7 @@ declare namespace MakerJs.path { * @param pathToRotate The path to rotate. * @param angleInDegrees The amount of rotation, in degrees. * @param rotationOrigin The center point of rotation. - * @returns The original path (for chaining). + * @returns The original path (for cascading). */ function rotate(pathToRotate: IPath, angleInDegrees: number, rotationOrigin?: IPoint): IPath; /** @@ -960,7 +980,7 @@ declare namespace MakerJs.path { * * @param pathToScale The path to scale. * @param scaleValue The amount of scaling. - * @returns The original path (for chaining). + * @returns The original path (for cascading). */ function scale(pathToScale: IPath, scaleValue: number): IPath; /** @@ -1215,11 +1235,11 @@ declare namespace MakerJs.model { */ function mirror(modelToMirror: IModel, mirrorX: boolean, mirrorY: boolean): IModel; /** - * Move a model to an absolute point. Note that this is also accomplished by directly setting the origin property. This function exists for chaining. + * Move a model to an absolute point. Note that this is also accomplished by directly setting the origin property. This function exists for cascading. * * @param modelToMove The model to move. * @param origin The new position of the model. - * @returns The original model (for chaining). + * @returns The original model (for cascading). */ function move(modelToMove: IModel, origin: IPoint): IModel; /** @@ -1227,7 +1247,7 @@ declare namespace MakerJs.model { * * @param modelToMove The model to move. * @param delta The x & y adjustments as a point object. - * @returns The original model (for chaining). + * @returns The original model (for cascading). */ function moveRelative(modelToMove: IModel, delta: IPoint): IModel; /** @@ -1235,7 +1255,7 @@ declare namespace MakerJs.model { * * @param modelToPrefix The model to prefix. * @param prefix The prefix to prepend on paths ids. - * @returns The original model (for chaining). + * @returns The original model (for cascading). */ function prefixPathIds(modelToPrefix: IModel, prefix: string): IModel; /** @@ -1244,7 +1264,7 @@ declare namespace MakerJs.model { * @param modelToRotate The model to rotate. * @param angleInDegrees The amount of rotation, in degrees. * @param rotationOrigin The center point of rotation. - * @returns The original model (for chaining). + * @returns The original model (for cascading). */ function rotate(modelToRotate: IModel, angleInDegrees: number, rotationOrigin?: IPoint): IModel; /** @@ -1253,7 +1273,7 @@ declare namespace MakerJs.model { * @param modelToScale The model to scale. * @param scaleValue The amount of scaling. * @param scaleOrigin Optional boolean to scale the origin point. Typically false for the root model. - * @returns The original model (for chaining). + * @returns The original model (for cascading). */ function scale(modelToScale: IModel, scaleValue: number, scaleOrigin?: boolean): IModel; /** @@ -1261,7 +1281,7 @@ declare namespace MakerJs.model { * * @param modeltoConvert The model to convert. * @param destUnitType The unit system. - * @returns The scaled model (for chaining). + * @returns The scaled model (for cascading). */ function convertUnits(modeltoConvert: IModel, destUnitType: string): IModel; /** @@ -1373,7 +1393,7 @@ declare namespace MakerJs.model { * * @param modelContext The originated model to search for similar paths. * @param options Optional options object. - * @returns The simplified model (for chaining). + * @returns The simplified model (for cascading). */ function simplify(modelToSimplify: IModel, options?: ISimplifyOptions): IModel; } @@ -1478,7 +1498,7 @@ declare namespace MakerJs.measure { * @param baseMeasure The measurement to increase. * @param addMeasure The additional measurement. * @param addOffset Optional offset point of the additional measurement. - * @returns The increased original measurement (for chaining). + * @returns The increased original measurement (for cascading). */ function increase(baseMeasure: IMeasure, addMeasure: IMeasure): IMeasure; /** @@ -1583,7 +1603,7 @@ declare namespace MakerJs.measure { * @param atlas Optional atlas to save measurements. * @returns object with low and high points. */ - function modelExtents(modelToMeasure: IModel, atlas?: measure.Atlas): IMeasure; + function modelExtents(modelToMeasure: IModel, atlas?: measure.Atlas): IMeasureWithCenter; /** * A list of maps of measurements. * @@ -1612,6 +1632,22 @@ declare namespace MakerJs.measure { constructor(modelContext: IModel); measureModels(): void; } + /** + * A hexagon which surrounds a model. + */ + interface IBoundingHex extends IModel { + /** + * Radius of the hexagon, which is also the length of a side. + */ + radius: number; + } + /** + * Measures the minimum bounding hexagon surrounding a model. The hexagon is oriented such that the right and left sides are vertical, and the top and bottom are pointed. + * + * @param modelToMeasure The model to measure. + * @returns IBoundingHex object which is a hexagon model, with an additional radius property. + */ + function boundingHexagon(modelToMeasure: IModel): IBoundingHex; } declare namespace MakerJs.exporter { /** @@ -1787,6 +1823,29 @@ declare namespace MakerJs.model { function findChains(modelContext: IModel, callback: IChainCallback, options?: IFindChainsOptions): void; } declare namespace MakerJs.chain { + /** + * Shift the links of an endless chain. + * + * @param chainContext Chain to cycle through. Must be endless. + * @param amount Optional number of links to shift. May be negative to cycle backwards. + * @returns The chainContext for cascading. + */ + function cycle(chainContext: IChain, amount?: number): IChain; + /** + * Reverse the links of a chain. + * + * @param chainContext Chain to reverse. + * @returns The chainContext for cascading. + */ + function reverse(chainContext: IChain): IChain; + /** + * Set the beginning of an endless chain to a known routeKey of a path. + * + * @param chainContext Chain to cycle through. Must be endless. + * @param routeKey RouteKey of the desired path to start the chain with. + * @returns The chainContext for cascading. + */ + function startAt(chainContext: IChain, routeKey: string): IChain; /** * Get points along a chain of paths. * @@ -1825,7 +1884,7 @@ declare namespace MakerJs.model { * * @param modelContext The model to search for dead ends. * @param options Optional options object. - * @returns The input model (for chaining). + * @returns The input model (for cascading). */ function removeDeadEnds(modelContext: IModel, pointMatchingDistance?: any, keep?: IWalkPathBooleanCallback): IModel; } @@ -2123,6 +2182,18 @@ declare namespace MakerJs.models { * @param numericList String containing a list of numbers which can be delimited by spaces, commas, or anything non-numeric (Note: [exponential notation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toExponential) is allowed). */ constructor(numericList: string); + /** + * Create a model by connecting points designated in a string. The model will be 'closed' - i.e. the last point will connect to the first point. + * + * Example: + * ``` + * var c = new makerjs.models.ConnectTheDots(false, '-10 0 10 0 0 20'); // 3 coordinates to form a polyline + * ``` + * + * @param isClosed Flag to specify if last point should connect to the first point. + * @param numericList String containing a list of numbers which can be delimited by spaces, commas, or anything non-numeric (Note: [exponential notation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toExponential) is allowed). + */ + constructor(isClosed: boolean, numericList: string); /** * Create a model by connecting points designated in a numeric array. The model will be 'closed' - i.e. the last point will connect to the first point. * @@ -2134,6 +2205,18 @@ declare namespace MakerJs.models { * @param coords Array of coordinates. */ constructor(coords: number[]); + /** + * Create a model by connecting points designated in a numeric array. The model will be 'closed' - i.e. the last point will connect to the first point. + * + * Example: + * ``` + * var c = new makerjs.models.ConnectTheDots(false, [-10, 0, 10, 0, 0, 20]); // 3 coordinates to form a polyline + * ``` + * + * @param isClosed Flag to specify if last point should connect to the first point. + * @param coords Array of coordinates. + */ + constructor(isClosed: boolean, coords: number[]); /** * Create a model by connecting points designated in an array of points. The model may be closed, or left open. * diff --git a/maker.js/maker.js-tests.ts b/maker.js/maker.js-tests.ts index 4c7dbc25f0..f5f9d9db16 100644 --- a/maker.js/maker.js-tests.ts +++ b/maker.js/maker.js-tests.ts @@ -51,6 +51,7 @@ function test() { makerjs.isPoint([]); makerjs.pathType.Circle; makerjs.round(44.44444, .01); + makerjs.travel(model, ''); makerjs.unitType.Millimeter; new makerjs.Collector(); } @@ -105,6 +106,7 @@ function test() { } function testMeasure() { + makerjs.measure.boundingHexagon(model).radius; makerjs.measure.increase(mp, mm); makerjs.measure.isPointEqual(p1, p2); makerjs.measure.isPathEqual(paths.line, paths.circle, 4); @@ -123,6 +125,7 @@ function test() { makerjs.measure.pointDistance([0,0], [9,9]); new makerjs.measure.Atlas(model); mm.low[0]; + mm.center; mp.high[1]; var s = makerjs.measure.lineSlope(paths.line); makerjs.measure.isPointOnSlope([], s); @@ -172,6 +175,10 @@ function test() { new makerjs.models.BoltCircle(7, 7, 7, 7), new makerjs.models.BoltRectangle(2, 2, 2), new makerjs.models.ConnectTheDots(true, [ [0,0], [1,1] ]), + new makerjs.models.ConnectTheDots([0, 0, 1, 1]), + new makerjs.models.ConnectTheDots(true, [0, 0, 1, 1]), + new makerjs.models.ConnectTheDots(true, '0, 0, 1, 1'), + new makerjs.models.ConnectTheDots('0, 0, 1, 1'), new makerjs.models.Dogbone(1,1,1), new makerjs.models.Dome(5, 7), new makerjs.models.Ellipse(2,2), @@ -255,7 +262,10 @@ function test() { } function testChain() { + makerjs.chain.cycle(chain, 7); makerjs.chain.fillet(chain, 1); + makerjs.chain.reverse(chain); + makerjs.chain.startAt(chain, ''); makerjs.chain.toKeyPoints(chain); makerjs.chain.toPoints(chain, 1); } From e5fdb745139a1199141168eceaf8260f1c14d5aa Mon Sep 17 00:00:00 2001 From: Artur-A Date: Sun, 12 Feb 2017 07:40:45 +0300 Subject: [PATCH 29/81] types for airbnb react-dates --- react-dates/index.d.ts | 364 +++++++++++++++++++++++++++++++ react-dates/react-dates-test.tsx | 357 ++++++++++++++++++++++++++++++ react-dates/tsconfig.json | 24 ++ 3 files changed, 745 insertions(+) create mode 100644 react-dates/index.d.ts create mode 100644 react-dates/react-dates-test.tsx create mode 100644 react-dates/tsconfig.json diff --git a/react-dates/index.d.ts b/react-dates/index.d.ts new file mode 100644 index 0000000000..b1e28cbe92 --- /dev/null +++ b/react-dates/index.d.ts @@ -0,0 +1,364 @@ +// Type definitions for react-dates v7.0.1 +// Project: https://github.com/airbnb/react-dates +// Definitions by: Artur Ampilogov +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 + +import moment from "moment"; +import * as React from "react"; + +export = ReactDates; + +declare namespace momentPropTypes{ + type momentObj = any; + type momentString = any; + type momentDurationObj = any; +} + + +declare namespace ReactDates{ + type AnchorDirectionShape = 'left' | 'right'; + type FocusedInputShape = 'startDate' | 'endDate'; + type OrientationShape = 'horizontal' | 'vertical'; + type ScrollableOrientationShape = 'horizontal' | 'vertical' | 'verticalScrollable'; + + + interface DateRangePickerShape{ + startDate?: momentPropTypes.momentObj, + endDate?: momentPropTypes.momentObj, + focusedInput?: FocusedInputShape, + screenReaderInputMessage?: string, + minimumNights?: number, + isDayBlocked?: (day: any) => boolean, + isOutsideRange?: (day: any) => boolean, + enableOutsideDays?: boolean, + reopenPickerOnClearDates?: boolean, + keepOpenOnDateSelect?: boolean, + numberOfMonths?: number, + showClearDates?: boolean, + disabled?: boolean, + required?: boolean, + showDefaultInputIcon?: boolean, + + orientation?: OrientationShape, + anchorDirection?: AnchorDirectionShape, + horizontalMargin?: number, + // portal options + withPortal?: boolean, + withFullScreenPortal?: boolean, + + startDateId?: string, + startDatePlaceholderText?: string, + endDateId?: string, + endDatePlaceholderText?: string, + + initialVisibleMonth?: () => moment.Moment, + onDatesChange?: (arg: { startDate: any, endDate: any }) => void, + onFocusChange?: (arg: FocusedInputShape) => void, + onPrevMonthClick?: (e: React.EventHandler>) => void, + onNextMonthClick?: (e: React.EventHandler>) => void, + + renderDay?: (day: any) => (string | JSX.Element), + + // i18n + displayFormat?: (string | (()=> string)), + monthFormat?: string, + phrases?: { + closeDatePicker: string | JSX.Element, + clearDates: string | JSX.Element, + } + } + + type DateRangePicker = React.ClassicComponentClass; + var DateRangePicker: React.ClassicComponentClass; + + interface SingleDatePickerShape{ + id: string, + placeholder?: string, + date?: momentPropTypes.momentObj, + focused?: boolean, + showClearDate?: boolean, + reopenPickerOnClearDates?: boolean, + keepOpenOnDateSelect?: boolean, + disabled?: boolean, + required?: boolean, + screenReaderInputMessage?: string, + + onDateChange?: (date: any) => void, + onFocusChange?: (arg: { focused: boolean | null }) => void, + + isDayBlocked?: (day: any) => boolean, + isOutsideRange?: (day: any) => boolean, + enableOutsideDays?: boolean, + numberOfMonths?: number, + orientation?: OrientationShape, + initialVisibleMonth?: () => moment.Moment, + anchorDirection?: AnchorDirectionShape, + horizontalMargin?: number, + + navPrev?: string | JSX.Element, + navNext?: string | JSX.Element, + + // portal options + withPortal?: boolean, + withFullScreenPortal?: boolean, + + onPrevMonthClick?: (e: React.EventHandler>) => void, + onNextMonthClick?: (e: React.EventHandler>) => void, + + renderDay?: (day: any) => (string | JSX.Element), + + // i18n + displayFormat?: (string | (()=> string)), + monthFormat?: string, + phrases?: { + closeDatePicker: string | JSX.Element, + }, + } + type SingleDatePicker = React.ClassicComponentClass; + var SingleDatePicker: React.ClassicComponentClass; + + + + interface DateRangePickerInputControllerShape { + startDate?: momentPropTypes.momentObj, + startDateId?: string, + startDatePlaceholderText?: string, + isStartDateFocused?: boolean, + + endDate?: momentPropTypes.momentObj, + endDateId?: string, + endDatePlaceholderText?: string, + isEndDateFocused?: boolean, + + screenReaderMessage?: string, + showClearDates?: boolean, + showCaret?: boolean, + showDefaultInputIcon?: boolean, + disabled?: boolean, + required?: boolean, + + keepOpenOnDateSelect?: boolean, + reopenPickerOnClearDates?: boolean, + withFullScreenPortal?: boolean, + isOutsideRange?: (day: any) => boolean, + displayFormat?: (string | (()=> string)), + + onFocusChange?: (arg: FocusedInputShape) => void, + onDatesChange?: (arg: { startDate: any, endDate: any }) => void, + + customInputIcon?: string | JSX.Element, + customArrowIcon?: string | JSX.Element, + + // i18n + phrases?: { + clearDates: string | JSX.Element, + } + } + type DateRangePickerInputController = React.ClassicComponentClass; + var DateRangePickerInputController: React.ClassicComponentClass; + + + + interface DateRangePickerInputShape{ + startDateId?: string, + startDatePlaceholderText?: string, + screenReaderMessage?: string, + + endDateId?: string, + endDatePlaceholderText?: string, + + onStartDateFocus?: (e: React.EventHandler>) => void, + onEndDateFocus?: (e: React.EventHandler>) => void, + onStartDateChange?: (e: React.EventHandler>) => void, + onEndDateChange?: (e: React.EventHandler>) => void, + onStartDateShiftTab?: (e: React.EventHandler>) => void, + onEndDateTab?: (e: React.EventHandler>) => void, + onClearDates?: (e: React.EventHandler>) => void, + + startDate?: string, + startDateValue?: string, + endDate?: string, + endDateValue?: string, + + isStartDateFocused?: boolean, + isEndDateFocused?: boolean, + showClearDates?: boolean, + disabled?: boolean, + required?: boolean, + showCaret?: boolean, + showDefaultInputIcon?: boolean, + customInputIcon?: string | JSX.Element, + customArrowIcon?: string | JSX.Element, + + // i18n + phrases?:{ + clearDates: string | JSX.Element, + }, + } + type DateRangePickerInput = React.ClassicComponentClass; + var DateRangePickerInput: React.ClassicComponentClass; + + + + interface SingleDatePickerInputShape{ + id: string, + placeholder?: string, // also used as label + displayValue?: string, + inputValue?: string, + screenReaderMessage?: string, + focused?: boolean, + disabled?: boolean, + required?: boolean, + showCaret?: boolean, + showClearDate?: boolean, + + onChange?: (e: React.EventHandler>) => void, + onClearDate?: (e: React.EventHandler>) => void, + onFocus?: (e: React.EventHandler>) => void, + onKeyDownShiftTab?: (e: React.EventHandler>) => void, + onKeyDownTab?: (e: React.EventHandler>) => void, + + // i18n + phrases?: { + clearDate: string | JSX.Element, + } + } + type SingleDatePickerInput = React.ClassicComponentClass; + var SingleDatePickerInput: React.ClassicComponentClass; + + + + + interface DayPickerShape{ + enableOutsideDays?: boolean, + numberOfMonths?: number, + modifiers?: any, + orientation?: ScrollableOrientationShape, + withPortal?: boolean, + hidden?: boolean, + initialVisibleMonth?: () => moment.Moment, + + navPrev?: string | JSX.Element, + navNext?: string | JSX.Element, + + onDayClick?: (day: any, e: React.EventHandler>) => void, + onDayMouseEnter?: (day: any, e: React.EventHandler>) => void, + onDayMouseLeave?: (day: any, e: React.EventHandler>) => void, + onPrevMonthClick?: (e: React.EventHandler>) => void, + onNextMonthClick?: (e: React.EventHandler>) => void, + onOutsideClick?: (e: MouseEvent) => void, + + renderDay?: (day: any) => (string | JSX.Element), + + // i18n + monthFormat?: string, + } + type DayPicker = React.ClassicComponentClass; + var DayPicker: React.ClassicComponentClass; + + + + interface DayPickerRangeControllerShape{ + startDate?: momentPropTypes.momentObj, + endDate?: momentPropTypes.momentObj, + onDatesChange?: (arg: { startDate: any, endDate: any }) => void, + + focusedInput?: FocusedInputShape, + onFocusChange?: (arg: FocusedInputShape) => void, + + keepOpenOnDateSelect?: boolean, + minimumNights?: number, + isOutsideRange?: (day: any) => boolean, + isDayBlocked?: (day: any) => boolean, + isDayHighlighted?: (day: any) => boolean, + + // DayPicker props + enableOutsideDays?: boolean, + numberOfMonths?: number, + orientation?: ScrollableOrientationShape, + withPortal?: boolean, + hidden?: boolean, + initialVisibleMonth?: () => moment.Moment, + + navPrev?: string | JSX.Element, + navNext?: string | JSX.Element, + + onPrevMonthClick?: (e: React.EventHandler>) => void, + onNextMonthClick?: (e: React.EventHandler>) => void, + onOutsideClick?: (e: MouseEvent) => void, + renderDay?: (day: any) => (string | JSX.Element), + + // i18n + monthFormat?: string, + } + type DayPickerRangeController = React.ClassicComponentClass; + var DayPickerRangeController: React.ClassicComponentClass; + + + interface CalendarMonthGridShape{ + enableOutsideDays?: boolean, + firstVisibleMonthIndex?: number, + initialMonth?: momentPropTypes.momentObj, + isAnimating?: boolean, + numberOfMonths?: number, + modifiers?: any, + orientation?: ScrollableOrientationShape, + onDayClick?: (day: any, e: React.EventHandler>) => void, + onDayMouseEnter?: (day: any, e: React.EventHandler>) => void, + onDayMouseLeave?: (day: any, e: React.EventHandler>) => void, + onMonthTransitionEnd?: ()=> void, + renderDay?: (day: any) => (string | JSX.Element), + transformValue?: string, + + // i18n + monthFormat?: string, + } + type CalendarMonthGrid = React.ClassicComponentClass; + var CalendarMonthGrid: React.ClassicComponentClass; + + + + interface CalendarMonthShape{ + month?: momentPropTypes.momentObj, + isVisible?: boolean, + enableOutsideDays?: boolean, + modifiers?: any, + orientation?: ScrollableOrientationShape, + onDayClick?: (day: any, e: React.EventHandler>) => void, + onDayMouseEnter?: (day: any, e: React.EventHandler>) => void, + onDayMouseLeave?: (day: any, e: React.EventHandler>) => void, + renderDay?: (day: any) => (string | JSX.Element), + + // i18n + monthFormat?: string, + } + type CalendarMonth = React.ClassicComponentClass; + var CalendarMonth: React.ClassicComponentClass; + + + interface CalendarDayShape{ + day?: momentPropTypes.momentObj, + isOutsideDay?: boolean, + modifiers?: any, + onDayClick?: (day: any, e: React.EventHandler>) => void, + onDayMouseEnter?: (day: any, e: React.EventHandler>) => void, + onDayMouseLeave?: (day: any, e: React.EventHandler>) => void, + renderDay?: (day: any) => (string | JSX.Element), + } + type CalendarDay = React.ClassicComponentClass; + var CalendarDay: React.ClassicComponentClass; + + + + + var isInclusivelyAfterDay: (a: moment.Moment, b: moment.Moment) => boolean; + var isInclusivelyBeforeDay: (a: moment.Moment, b: moment.Moment) => boolean; + var isNextDay: (a: moment.Moment, b: moment.Moment) => boolean; + var isSameDay: (a: moment.Moment, b: moment.Moment) => boolean; + + var toISODateString: (date: moment.MomentInput, currentFormat: moment.MomentFormatSpecification) => string | null; + var toLocalizedDateString: (date: moment.MomentInput, currentFormat: moment.MomentFormatSpecification) => string | null; + + var toMomentObject: (dateString: moment.MomentInput, customFormat: moment.MomentFormatSpecification) => moment.Moment | null; +} diff --git a/react-dates/react-dates-test.tsx b/react-dates/react-dates-test.tsx new file mode 100644 index 0000000000..0878bfb141 --- /dev/null +++ b/react-dates/react-dates-test.tsx @@ -0,0 +1,357 @@ +import moment from "moment"; +import * as React from "react"; + +import { + CalendarDay, + CalendarMonth, + CalendarMonthGrid, + SingleDatePickerInput, + SingleDatePicker, + DayPicker, + DayPickerRangeController, + DateRangePickerInput, + DateRangePickerInputController, + DateRangePicker, + isInclusivelyAfterDay, + isInclusivelyBeforeDay, + isNextDay, + isSameDay, + toISODateString, + toLocalizedDateString, + toMomentObject} from "react-dates"; + + +class CalendarDayRenderingMinimumTest extends React.Component<{}, {}> { + render() { + return + } +} + +class CalendarDayRenderingFullTest extends React.Component<{}, {}> { + render() { + return day.toString()} + onDayClick={(day,e) => {}} + onDayMouseEnter={(day,e) => {}} + onDayMouseLeave={(day,e) => {}} + /> + } +} + +class CalendarMonthMinimumTest extends React.Component<{}, {}> { + render() { + return + } +} + +class CalendarMonthFullTest extends React.Component<{}, {}> { + render() { + return day.toString()} + onDayClick={(day,e) => {}} + onDayMouseEnter={(day,e) => {}} + onDayMouseLeave={(day,e) => {}} + /> + } +} + + + + +class SingleDatePickerInputMinimumTest extends React.Component<{}, {}> { + render() { + return + } +} + +class SingleDatePickerInputFullTest extends React.Component<{}, {}> { + render() { + return {}} + onClearDate={e => {}} + onFocus={e => {}} + onKeyDownShiftTab={e => {}} + onKeyDownTab={e => {}} + phrases={{clearDate: "clear"}} + placeholder="test" + required={false} + screenReaderMessage="arial-test" + showCaret={true} + showClearDate={true} + /> + } +} + + + + +class SingleDatePickerMinimumTest extends React.Component<{}, {}> { + render() { + return + } +} + +class SingleDatePickerFullTest extends React.Component<{}, {}> { + render() { + return moment()} + placeholder="test" + required={false} + showClearDate={true} + isDayBlocked={(day:any)=> false} + isOutsideRange={(day:any)=> false} + keepOpenOnDateSelect={true} + navNext="next" + navPrev="prev" + withPortal={false} + onDateChange={d => {}} + focused={false} + phrases={{closeDatePicker: Close}} + reopenPickerOnClearDates={true} + screenReaderInputMessage="arial-test" + withFullScreenPortal={true} + onFocusChange={arg => {}} + onNextMonthClick={e => {}} + onPrevMonthClick={e => {}} + numberOfMonths={2} + orientation="horizontal" + monthFormat="MM" + renderDay={day => day.toString()} + /> + } +} + + + +class DayPickerRangeControllerMinimumTest extends React.Component<{}, {}> { + render() { + return + } +} + +class DayPickerRangeControllerFullTest extends React.Component<{}, {}> { + render() { + return moment()} + hidden={false} + isDayBlocked={(day:any)=> false} + isDayHighlighted={(day:any)=> false} + isOutsideRange={(day:any)=> false} + keepOpenOnDateSelect={true} + minimumNights={3} + navNext="next" + navPrev="prev" + withPortal={false} + onDatesChange={arg => {}} + onFocusChange={arg => {}} + onNextMonthClick={e => {}} + onPrevMonthClick={e => {}} + onOutsideClick={e => {}} + enableOutsideDays={true} + numberOfMonths={2} + orientation="horizontal" + monthFormat="MM" + renderDay={day => day.toString()} + /> + } +} + + +class DayPickerTest extends React.Component<{}, {}> { + render() { + return + } +} + +class DayPickerFullTest extends React.Component<{}, {}> { + render() { + return {}} + onDayMouseEnter={(day,e)=>{}} + onDayMouseLeave={(day,e)=>{}} + initialVisibleMonth={() => moment()} + hidden={false} + navNext="next" + navPrev="prev" + withPortal={false} + onNextMonthClick={e => {}} + onPrevMonthClick={e => {}} + onOutsideClick={e => {}} + enableOutsideDays={true} + numberOfMonths={2} + orientation="horizontal" + monthFormat="MM" + renderDay={day => day.toString()} + /> + } +} + + + + +class DateRangePickerInputMinimumTest extends React.Component<{}, {}> { + render() { + return + } +} + +class DateRangePickerInputFullTest extends React.Component<{}, {}> { + render() { + return {}} + onEndDateChange={e => {}} + onEndDateFocus={e => {}} + onEndDateTab={e => {}} + onStartDateChange={e => {}} + onStartDateFocus={e => {}} + onStartDateShiftTab={e => {}} + showDefaultInputIcon={true} + required={false} + screenReaderMessage="arial-test" + showCaret={true} + showClearDates={true} + phrases={{clearDates: "clear"}} + /> + } +} + + + + + +class DateRangePickerInputControllerMinimumTest extends React.Component<{}, {}> { + render() { + return + } +} + +class DateRangePickerInputControllerFullTest extends React.Component<{}, {}> { + render() { + return {}} + onEndDateChange={e => {}} + onEndDateFocus={e => {}} + onEndDateTab={e => {}} + onStartDateChange={e => {}} + onStartDateFocus={e => {}} + onStartDateShiftTab={e => {}} + showDefaultInputIcon={true} + required={false} + screenReaderMessage="arial-test" + showCaret={true} + showClearDates={true} + phrases={{clearDates: "clear"}} + startDate="1.1.2020" + endDate="1.1.2020" + /> + } +} + + + + + + + + + + + +class DateRangePickerMinimumTest extends React.Component<{}, {}> { + render() { + return + } +} + +class DateRangePickerFullTest extends React.Component<{}, {}> { + render() { + return {arg.startDate; arg.endDate;}} + displayFormat="dd.mm.yyyy" + enableOutsideDays={true} + horizontalMargin={20} + initialVisibleMonth={() => moment()} + isDayBlocked={(day:any)=> false} + isOutsideRange={(day:any)=> false} + keepOpenOnDateSelect={true} + withPortal={false} + reopenPickerOnClearDates={true} + screenReaderInputMessage="arial-test" + withFullScreenPortal={true} + onFocusChange={arg => {}} + onNextMonthClick={e => {}} + onPrevMonthClick={e => {}} + numberOfMonths={2} + orientation="horizontal" + monthFormat="MM" + renderDay={day => day.toString()} + /> + } +} + + +const isInclusivelyAfterDayResult: boolean = isInclusivelyAfterDay(moment(),moment()); +const isInclusivelyBeforeDayResult: boolean = isInclusivelyBeforeDay(moment(),moment()); +const isNextDayDayResult: boolean = isNextDay(moment(),moment()); +const isSameDayResult: boolean = isSameDay(moment(),moment()); +const toISODateStringResult: string | null = toISODateString(moment(), "dd.mm.yyyy"); +const toLocalizedDateStringResult: string | null = toLocalizedDateString(moment(), "dd.mm.yyyy"); +const toMomentObjectResult: moment.Moment | null = toMomentObject(moment(), "dd.mm.yyyy"); + + \ No newline at end of file diff --git a/react-dates/tsconfig.json b/react-dates/tsconfig.json new file mode 100644 index 0000000000..943c51e1e6 --- /dev/null +++ b/react-dates/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "jsx": "react", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "react-day-picker-tests.tsx" + ] +} From 6e9010d7bd19edafe047a292c247d499d495af2f Mon Sep 17 00:00:00 2001 From: Artur-A Date: Sun, 12 Feb 2017 07:44:08 +0300 Subject: [PATCH 30/81] fixed tscofig.json --- react-dates/{react-dates-test.tsx => react-dates-tests.tsx} | 0 react-dates/tsconfig.json | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename react-dates/{react-dates-test.tsx => react-dates-tests.tsx} (100%) diff --git a/react-dates/react-dates-test.tsx b/react-dates/react-dates-tests.tsx similarity index 100% rename from react-dates/react-dates-test.tsx rename to react-dates/react-dates-tests.tsx diff --git a/react-dates/tsconfig.json b/react-dates/tsconfig.json index 943c51e1e6..7d246baede 100644 --- a/react-dates/tsconfig.json +++ b/react-dates/tsconfig.json @@ -19,6 +19,6 @@ }, "files": [ "index.d.ts", - "react-day-picker-tests.tsx" + "react-dates-tests.tsx" ] } From 3f9b056eaaa233b6585c49b88cda9bb426923de3 Mon Sep 17 00:00:00 2001 From: Artur-A Date: Sun, 12 Feb 2017 08:05:53 +0300 Subject: [PATCH 31/81] added moment dependency --- react-dates/index.d.ts | 2 +- react-dates/package.json | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 react-dates/package.json diff --git a/react-dates/index.d.ts b/react-dates/index.d.ts index b1e28cbe92..8a1ac11441 100644 --- a/react-dates/index.d.ts +++ b/react-dates/index.d.ts @@ -4,8 +4,8 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.1 -import moment from "moment"; import * as React from "react"; +import moment from "moment"; export = ReactDates; diff --git a/react-dates/package.json b/react-dates/package.json new file mode 100644 index 0000000000..d5ac741601 --- /dev/null +++ b/react-dates/package.json @@ -0,0 +1,5 @@ +{ + "dependencies": { + "moment": ">=2.17.1" + } +} \ No newline at end of file From 4ec7d1b63aabeee74fc2591ad11361096e7891ec Mon Sep 17 00:00:00 2001 From: Artur-A Date: Sun, 12 Feb 2017 08:19:01 +0300 Subject: [PATCH 32/81] fixing moment import --- react-dates/index.d.ts | 2 +- react-dates/package.json | 2 +- react-dates/react-dates-tests.tsx | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/react-dates/index.d.ts b/react-dates/index.d.ts index 8a1ac11441..e3ca801887 100644 --- a/react-dates/index.d.ts +++ b/react-dates/index.d.ts @@ -5,7 +5,7 @@ // TypeScript Version: 2.1 import * as React from "react"; -import moment from "moment"; +import * as moment from "moment"; export = ReactDates; diff --git a/react-dates/package.json b/react-dates/package.json index d5ac741601..ed92982595 100644 --- a/react-dates/package.json +++ b/react-dates/package.json @@ -1,5 +1,5 @@ { "dependencies": { - "moment": ">=2.17.1" + "moment": "^2.17.1" } } \ No newline at end of file diff --git a/react-dates/react-dates-tests.tsx b/react-dates/react-dates-tests.tsx index 0878bfb141..b975b1124b 100644 --- a/react-dates/react-dates-tests.tsx +++ b/react-dates/react-dates-tests.tsx @@ -1,5 +1,5 @@ -import moment from "moment"; import * as React from "react"; +import * as moment from "moment"; import { CalendarDay, From 4b53f02b05e53e2675df2ab97afa9e8cf4480f7d Mon Sep 17 00:00:00 2001 From: Artur-A Date: Sun, 12 Feb 2017 08:25:02 +0300 Subject: [PATCH 33/81] set strong min moment version with ts 2.0 support --- react-dates/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/react-dates/package.json b/react-dates/package.json index ed92982595..d5ac741601 100644 --- a/react-dates/package.json +++ b/react-dates/package.json @@ -1,5 +1,5 @@ { "dependencies": { - "moment": "^2.17.1" + "moment": ">=2.17.1" } } \ No newline at end of file From f4af19ba71d321344a55d0b6c97b1ca0a7d47ad8 Mon Sep 17 00:00:00 2001 From: "sebdoucet@gmail.com" Date: Sun, 12 Feb 2017 11:59:36 -0500 Subject: [PATCH 34/81] Fix type parameter for setObject parameter --- chrome/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/chrome/index.d.ts b/chrome/index.d.ts index 211375a3fe..b88ae5faf0 100644 --- a/chrome/index.d.ts +++ b/chrome/index.d.ts @@ -1831,7 +1831,7 @@ declare namespace chrome.devtools.panels { * If you specify the callback parameter, it should be a function that looks like this: * function() {...}; */ - setObject(jsonObject: string, rootTitle?: string, callback?: () => void): void; + setObject(jsonObject: Object, rootTitle?: string, callback?: () => void): void; /** * Sets a JSON-compliant object to be displayed in the sidebar pane. * @param jsonObject An object to be displayed in context of the inspected page. Evaluated in the context of the caller (API client). @@ -1839,7 +1839,7 @@ declare namespace chrome.devtools.panels { * If you specify the callback parameter, it should be a function that looks like this: * function() {...}; */ - setObject(jsonObject: string, callback?: () => void): void; + setObject(jsonObject: Object, callback?: () => void): void; /** * Sets an HTML page to be displayed in the sidebar pane. * @param path Relative path of an extension page to display within the sidebar. From 9505baf036887c87e752cbc7b1e137f8b2f023e4 Mon Sep 17 00:00:00 2001 From: Karol Janyst Date: Mon, 13 Feb 2017 14:20:22 +0900 Subject: [PATCH 35/81] Update definitions for react-color --- react-color/index.d.ts | 284 +++--------------- react-color/lib/components/alpha/Alpha.d.ts | 9 + react-color/lib/components/block/Block.d.ts | 9 + react-color/lib/components/chrome/Chrome.d.ts | 8 + react-color/lib/components/circle/Circle.d.ts | 9 + react-color/lib/components/common/Alpha.d.ts | 6 + .../lib/components/common/Checkboard.d.ts | 9 + .../lib/components/common/ColorWrap.d.ts | 11 + .../lib/components/common/EditableInput.d.ts | 19 ++ react-color/lib/components/common/Hue.d.ts | 8 + .../lib/components/common/Saturation.d.ts | 6 + react-color/lib/components/common/index.d.ts | 5 + .../lib/components/compact/Compact.d.ts | 8 + react-color/lib/components/github/Github.d.ts | 9 + react-color/lib/components/hue/Hue.d.ts | 9 + .../lib/components/material/Material.d.ts | 6 + .../lib/components/photoshop/Photoshop.d.ts | 10 + react-color/lib/components/sketch/Sketch.d.ts | 10 + react-color/lib/components/slider/Slider.d.ts | 6 + .../lib/components/swatches/Swatches.d.ts | 10 + .../lib/components/twitter/Twitter.d.ts | 6 + react-color/react-color-tests.tsx | 11 +- react-color/tsconfig.json | 6 +- react-color/tslint.json | 1 + 24 files changed, 231 insertions(+), 244 deletions(-) create mode 100644 react-color/lib/components/alpha/Alpha.d.ts create mode 100644 react-color/lib/components/block/Block.d.ts create mode 100644 react-color/lib/components/chrome/Chrome.d.ts create mode 100644 react-color/lib/components/circle/Circle.d.ts create mode 100644 react-color/lib/components/common/Alpha.d.ts create mode 100644 react-color/lib/components/common/Checkboard.d.ts create mode 100644 react-color/lib/components/common/ColorWrap.d.ts create mode 100644 react-color/lib/components/common/EditableInput.d.ts create mode 100644 react-color/lib/components/common/Hue.d.ts create mode 100644 react-color/lib/components/common/Saturation.d.ts create mode 100644 react-color/lib/components/common/index.d.ts create mode 100644 react-color/lib/components/compact/Compact.d.ts create mode 100644 react-color/lib/components/github/Github.d.ts create mode 100644 react-color/lib/components/hue/Hue.d.ts create mode 100644 react-color/lib/components/material/Material.d.ts create mode 100644 react-color/lib/components/photoshop/Photoshop.d.ts create mode 100644 react-color/lib/components/sketch/Sketch.d.ts create mode 100644 react-color/lib/components/slider/Slider.d.ts create mode 100644 react-color/lib/components/swatches/Swatches.d.ts create mode 100644 react-color/lib/components/twitter/Twitter.d.ts create mode 100644 react-color/tslint.json diff --git a/react-color/index.d.ts b/react-color/index.d.ts index bed3ae46ff..ca1b7a5f65 100644 --- a/react-color/index.d.ts +++ b/react-color/index.d.ts @@ -1,249 +1,57 @@ -// Type definitions for react-color v2.3.4 +// Type definitions for react-color 2.11 // Project: https://casesandberg.github.io/react-color/ // Definitions by: Karol Janyst // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.1 -/// +import { ComponentClass, ClassAttributes, StatelessComponent, ReactNode } from "react"; -declare namespace ReactColor { - interface HSLColor { - a?: number - h: number - l: number - s: number - } - - interface RGBColor { - a?: number - b: number - g: number - r: number - } - - type Color = string | HSLColor | RGBColor - - interface ColorResult { - hex: string - hsl: HSLColor - rgb: RGBColor - } - - type ColorChangeHandler = (color: ColorResult) => void - - interface ColorPickerProps extends React.ClassAttributes { - color?: Color - onChange?: ColorChangeHandler - onChangeComplete?: ColorChangeHandler - } - - /* Predefined pickers */ - interface AlphaPickerProps extends ColorPickerProps { - height?: string - width?: string - } - interface AlphaPicker extends React.ComponentClass {} - const AlphaPicker: AlphaPicker - - interface BlockPickerProps extends ColorPickerProps { - colors?: Array - width?: string - } - interface BlockPicker extends React.ComponentClass {} - const BlockPicker: BlockPicker - - interface ChromePickerProps extends ColorPickerProps { - disableAlpha?: boolean - } - interface ChromePicker extends React.ComponentClass {} - const ChromePicker: ChromePicker - - interface CirclePickerProps extends ColorPickerProps { - colors?: Array - width?: string - } - interface CirclePicker extends React.ComponentClass {} - const CirclePicker: CirclePicker - - interface CompactPickerProps extends ColorPickerProps { - colors?: Array - } - interface CompactPicker extends React.ComponentClass {} - const CompactPicker: CompactPicker - - interface GithubPickerProps extends ColorPickerProps { - colors?: Array - width?: string - } - interface GithubPicker extends React.ComponentClass {} - const GithubPicker: GithubPicker - - interface HuePickerProps extends ColorPickerProps { - height?: string - width?: string - } - interface HuePicker extends React.ComponentClass {} - const HuePicker: HuePicker - - interface MaterialPickerProps extends ColorPickerProps {} - interface MaterialPicker extends React.ComponentClass {} - const MaterialPicker: MaterialPicker - - interface PhotoshopPickerProps extends ColorPickerProps { - header?: string - onAccept?: ColorChangeHandler - onCancel?: ColorChangeHandler - } - interface PhotoshopPicker extends React.ComponentClass {} - const PhotoshopPicker: PhotoshopPicker - - interface SketchPickerProps extends ColorPickerProps { - disableAlpha?: boolean - presetColors?: Array - width?: string - } - interface SketchPicker extends React.ComponentClass {} - const SketchPicker: SketchPicker - - interface SliderPickerProps extends ColorPickerProps {} - interface SliderPicker extends React.ComponentClass {} - const SliderPicker: SliderPicker - - interface SwatchesPickerProps extends ColorPickerProps { - colors?: Array> - height?: number - width?: number - } - interface SwatchesPicker extends React.ComponentClass {} - const SwatchesPicker: SwatchesPicker - - interface TwitterPickerProps extends ColorPickerProps {} - interface TwitterPicker extends React.ComponentClass {} - const TwitterPicker: TwitterPicker - - /* For custom picker */ - interface InjectedColorProps { - hex?: string - hsl?: HSLColor - rgb?: RGBColor - onChange?: ColorChangeHandler - } - - function CustomPicker(component: React.ComponentClass | React.StatelessComponent): React.ComponentClass - - interface CustomPickerProps extends React.ClassAttributes { - color?: Color - pointer?: React.ReactNode - onChange?: ColorChangeHandler - } - - interface AlphaProps extends CustomPickerProps {} - interface Alpha extends React.ComponentClass {} - const Alpha: Alpha - - interface EditableInputStyles { - input?: React.CSSProperties - label?: React.CSSProperties - wrap?: React.CSSProperties - } - interface EditableInputProps extends React.ClassAttributes { - color?: Color - label?: string - onChange?: ColorChangeHandler - styles?: EditableInputStyles - value?: any - } - interface EditableInput extends React.ComponentClass {} - const EditableInput: EditableInput - - interface HueProps extends CustomPickerProps { - direction?: "horizontal" | "vertical" - } - interface Hue extends React.ComponentClass {} - const Hue: Hue - - interface SaturationProps extends CustomPickerProps {} - interface Saturation extends React.ComponentClass {} - const Saturation: Saturation - - interface CheckboardProps extends React.ClassAttributes { - grey?: string - size?: number - white?: string - } - interface Checkboard extends React.ComponentClass {} - const Checkboard: Checkboard +export interface HSLColor { + a?: number; + h: number; + l: number; + s: number; } -declare module "react-color/lib/components/common/Alpha" { export default ReactColor.Alpha } -declare module "react-color/lib/components/common/Checkboard" { export default ReactColor.Checkboard } -declare module "react-color/lib/components/common/EditableInput" { export default ReactColor.EditableInput } -declare module "react-color/lib/components/common/Hue" { export default ReactColor.Hue } -declare module "react-color/lib/components/common/Saturation" { export default ReactColor.Saturation } -declare module "react-color/lib/components/common/ColorWrap" { export default ReactColor.CustomPicker } - -declare module "react-color/lib/components/common" { - import Alpha from "react-color/lib/components/common/Alpha" - import Checkboard from "react-color/lib/components/common/Checkboard" - import EditableInput from "react-color/lib/components/common/EditableInput" - import Hue from "react-color/lib/components/common/Hue" - import Saturation from "react-color/lib/components/common/Saturation" - - export { - Alpha, - Checkboard, - EditableInput, - Hue, - Saturation - } +export interface RGBColor { + a?: number; + b: number; + g: number; + r: number; } -declare module "react-color/lib/components/alpha/Alpha" { export default ReactColor.AlphaPicker } -declare module "react-color/lib/components/block/Block" { export default ReactColor.BlockPicker } -declare module "react-color/lib/components/chrome/Chrome" { export default ReactColor.ChromePicker } -declare module "react-color/lib/components/circle/Circle" { export default ReactColor.CirclePicker } -declare module "react-color/lib/components/compact/Compact" { export default ReactColor.CompactPicker } -declare module "react-color/lib/components/github/Github" { export default ReactColor.GithubPicker } -declare module "react-color/lib/components/hue/Hue" { export default ReactColor.HuePicker } -declare module "react-color/lib/components/meterial/Material" { export default ReactColor.MaterialPicker } -declare module "react-color/lib/components/photoshop/Photoshop" { export default ReactColor.PhotoshopPicker } -declare module "react-color/lib/components/sketch/Sketch" { export default ReactColor.SketchPicker } -declare module "react-color/lib/components/slider/Slider" { export default ReactColor.SliderPicker } -declare module "react-color/lib/components/swatches/Swatches" { export default ReactColor.SwatchesPicker } -declare module "react-color/lib/components/twitter/Twitter" { export default ReactColor.TwitterPicker } +export type Color = string | HSLColor | RGBColor; -declare module "react-color" { - import AlphaPicker from "react-color/lib/components/alpha/Alpha" - import BlockPicker from "react-color/lib/components/block/Block" - import ChromePicker from "react-color/lib/components/chrome/Chrome" - import CirclePicker from "react-color/lib/components/circle/Circle" - import CompactPicker from "react-color/lib/components/compact/Compact" - import GithubPicker from "react-color/lib/components/github/Github" - import HuePicker from "react-color/lib/components/hue/Hue" - import MaterialPicker from "react-color/lib/components/meterial/Material" - import PhotoshopPicker from "react-color/lib/components/photoshop/Photoshop" - import SketchPicker from "react-color/lib/components/sketch/Sketch" - import SliderPicker from "react-color/lib/components/slider/Slider" - import SwatchesPicker from "react-color/lib/components/swatches/Swatches" - import TwitterPicker from "react-color/lib/components/twitter/Twitter" - import CustomPicker from "react-color/lib/components/common/ColorWrap" - - export type CustomPickerProps = ReactColor.CustomPickerProps - - export { - AlphaPicker, - BlockPicker, - ChromePicker, - CirclePicker, - CompactPicker, - GithubPicker, - HuePicker, - MaterialPicker, - PhotoshopPicker, - SketchPicker, - SliderPicker, - SwatchesPicker, - TwitterPicker, - CustomPicker - } +export interface ColorResult { + hex: string; + hsl: HSLColor; + rgb: RGBColor; } + +export type ColorChangeHandler = (color: ColorResult) => void; + +export interface ColorPickerProps extends ClassAttributes { + color?: Color; + onChange?: ColorChangeHandler; + onChangeComplete?: ColorChangeHandler; +} + +export interface CustomPickerProps extends ClassAttributes { + color?: Color; + pointer?: ReactNode; + onChange: ColorChangeHandler; +} + +export { default as AlphaPicker, AlphaPickerProps } from "react-color/lib/components/alpha/Alpha"; +export { default as BlockPicker, BlockPickerProps } from "react-color/lib/components/block/Block"; +export { default as ChromePicker, ChromePickerProps } from "react-color/lib/components/chrome/Chrome"; +export { default as CirclePicker, CirclePickerProps } from "react-color/lib/components/circle/Circle"; +export { default as CompactPicker, CompactPickerProps } from "react-color/lib/components/compact/Compact"; +export { default as GithubPicker, GithubPickerProps } from "react-color/lib/components/github/Github"; +export { default as HuePicker, HuePickerProps } from "react-color/lib/components/hue/Hue"; +export { default as MaterialPicker, MaterialPickerProps } from "react-color/lib/components/material/Material"; +export { default as PhotoshopPicker, PhotoshopPickerProps } from "react-color/lib/components/photoshop/Photoshop"; +export { default as SketchPicker, SketchPickerProps } from "react-color/lib/components/sketch/Sketch"; +export { default as SliderPicker, SliderPickerProps } from "react-color/lib/components/slider/Slider"; +export { default as SwatchesPicker, SwatchesPickerProps } from "react-color/lib/components/swatches/Swatches"; +export { default as TwitterPicker, TwitterPickerProps } from "react-color/lib/components/twitter/Twitter"; +export { default as CustomPicker, InjectedColorProps } from "react-color/lib/components/common/ColorWrap"; diff --git a/react-color/lib/components/alpha/Alpha.d.ts b/react-color/lib/components/alpha/Alpha.d.ts new file mode 100644 index 0000000000..2856f077b9 --- /dev/null +++ b/react-color/lib/components/alpha/Alpha.d.ts @@ -0,0 +1,9 @@ +import { Component } from "react"; +import { ColorPickerProps } from "react-color"; + +export interface AlphaPickerProps extends ColorPickerProps { + height?: string; + width?: string; +} + +export default class AlphaPicker extends Component {} diff --git a/react-color/lib/components/block/Block.d.ts b/react-color/lib/components/block/Block.d.ts new file mode 100644 index 0000000000..edb3c72347 --- /dev/null +++ b/react-color/lib/components/block/Block.d.ts @@ -0,0 +1,9 @@ +import { Component } from "react"; +import { ColorPickerProps } from "react-color"; + +export interface BlockPickerProps extends ColorPickerProps { + colors?: string[]; + width?: string; +} + +export default class BlockPicker extends Component {} diff --git a/react-color/lib/components/chrome/Chrome.d.ts b/react-color/lib/components/chrome/Chrome.d.ts new file mode 100644 index 0000000000..fa214d1b14 --- /dev/null +++ b/react-color/lib/components/chrome/Chrome.d.ts @@ -0,0 +1,8 @@ +import { Component } from "react"; +import { ColorPickerProps } from "react-color"; + +export interface ChromePickerProps extends ColorPickerProps { + disableAlpha?: boolean; +} + +export default class ChromePicker extends Component {} diff --git a/react-color/lib/components/circle/Circle.d.ts b/react-color/lib/components/circle/Circle.d.ts new file mode 100644 index 0000000000..204842d72a --- /dev/null +++ b/react-color/lib/components/circle/Circle.d.ts @@ -0,0 +1,9 @@ +import { Component } from "react"; +import { ColorPickerProps } from "react-color"; + +export interface CirclePickerProps extends ColorPickerProps { + colors?: string[]; + width?: string; +} + +export default class CirclePicker extends Component {} diff --git a/react-color/lib/components/common/Alpha.d.ts b/react-color/lib/components/common/Alpha.d.ts new file mode 100644 index 0000000000..da20010497 --- /dev/null +++ b/react-color/lib/components/common/Alpha.d.ts @@ -0,0 +1,6 @@ +import { Component } from "react"; +import { CustomPickerProps } from "react-color"; + +export type AlphaProps = CustomPickerProps; + +export default class Alpha extends Component {} diff --git a/react-color/lib/components/common/Checkboard.d.ts b/react-color/lib/components/common/Checkboard.d.ts new file mode 100644 index 0000000000..40d8f26913 --- /dev/null +++ b/react-color/lib/components/common/Checkboard.d.ts @@ -0,0 +1,9 @@ +import { Component, ClassAttributes } from "react"; + +export interface CheckboardProps extends ClassAttributes { + grey?: string; + size?: number; + white?: string; +} + +export default class Checkboard extends Component {} diff --git a/react-color/lib/components/common/ColorWrap.d.ts b/react-color/lib/components/common/ColorWrap.d.ts new file mode 100644 index 0000000000..94a8f5b789 --- /dev/null +++ b/react-color/lib/components/common/ColorWrap.d.ts @@ -0,0 +1,11 @@ +import { ComponentClass, StatelessComponent } from "react"; +import { HSLColor, RGBColor, ColorChangeHandler } from "react-color"; + +export interface InjectedColorProps { + hex?: string; + hsl?: HSLColor; + rgb?: RGBColor; + onChange?: ColorChangeHandler; +} + +export default function CustomPicker(component: ComponentClass | StatelessComponent): ComponentClass; diff --git a/react-color/lib/components/common/EditableInput.d.ts b/react-color/lib/components/common/EditableInput.d.ts new file mode 100644 index 0000000000..78df9473f2 --- /dev/null +++ b/react-color/lib/components/common/EditableInput.d.ts @@ -0,0 +1,19 @@ +import { Component, ClassAttributes, CSSProperties } from "react"; +import { Color, ColorChangeHandler } from "react-color"; + +export interface EditableInputStyles { + input?: CSSProperties; + label?: CSSProperties; + wrap?: CSSProperties; +} + +export interface EditableInputProps extends ClassAttributes { + color?: Color; + label?: string; + onChange?: ColorChangeHandler; + styles?: EditableInputStyles; + value?: any; +} + +export default class EditableInput extends Component {} + diff --git a/react-color/lib/components/common/Hue.d.ts b/react-color/lib/components/common/Hue.d.ts new file mode 100644 index 0000000000..1f61841107 --- /dev/null +++ b/react-color/lib/components/common/Hue.d.ts @@ -0,0 +1,8 @@ +import { Component } from "react"; +import { CustomPickerProps } from "react-color"; + +export interface HueProps extends CustomPickerProps { + direction?: "horizontal" | "vertical"; +} + +export default class Hue extends Component {} diff --git a/react-color/lib/components/common/Saturation.d.ts b/react-color/lib/components/common/Saturation.d.ts new file mode 100644 index 0000000000..c90a7d9685 --- /dev/null +++ b/react-color/lib/components/common/Saturation.d.ts @@ -0,0 +1,6 @@ +import { Component } from "react"; +import { CustomPickerProps } from "react-color"; + +export type SaturationProps = CustomPickerProps; + +export default class Saturation extends Component {} diff --git a/react-color/lib/components/common/index.d.ts b/react-color/lib/components/common/index.d.ts new file mode 100644 index 0000000000..ed5af44bdf --- /dev/null +++ b/react-color/lib/components/common/index.d.ts @@ -0,0 +1,5 @@ +export { default as Alpha } from "react-color/lib/components/common/Alpha"; +export { default as Checkboard } from "react-color/lib/components/common/Checkboard"; +export { default as EditableInput } from "react-color/lib/components/common/EditableInput"; +export { default as Hue } from "react-color/lib/components/common/Hue"; +export { default as Saturation } from "react-color/lib/components/common/Saturation"; diff --git a/react-color/lib/components/compact/Compact.d.ts b/react-color/lib/components/compact/Compact.d.ts new file mode 100644 index 0000000000..3f9ff74f60 --- /dev/null +++ b/react-color/lib/components/compact/Compact.d.ts @@ -0,0 +1,8 @@ +import { Component } from "react"; +import { ColorPickerProps } from "react-color"; + +export interface CompactPickerProps extends ColorPickerProps { + colors?: string[]; +} + +export default class CompactPicker extends Component {} diff --git a/react-color/lib/components/github/Github.d.ts b/react-color/lib/components/github/Github.d.ts new file mode 100644 index 0000000000..fd1479abad --- /dev/null +++ b/react-color/lib/components/github/Github.d.ts @@ -0,0 +1,9 @@ +import { Component } from "react"; +import { ColorPickerProps } from "react-color"; + +export interface GithubPickerProps extends ColorPickerProps { + colors?: string[]; + width?: string; +} + +export default class GithubPicker extends Component {} diff --git a/react-color/lib/components/hue/Hue.d.ts b/react-color/lib/components/hue/Hue.d.ts new file mode 100644 index 0000000000..6aab83baea --- /dev/null +++ b/react-color/lib/components/hue/Hue.d.ts @@ -0,0 +1,9 @@ +import { Component } from "react"; +import { ColorPickerProps } from "react-color"; + +export interface HuePickerProps extends ColorPickerProps { + height?: string; + width?: string; +} + +export default class HuePicker extends Component {} diff --git a/react-color/lib/components/material/Material.d.ts b/react-color/lib/components/material/Material.d.ts new file mode 100644 index 0000000000..4ae849b910 --- /dev/null +++ b/react-color/lib/components/material/Material.d.ts @@ -0,0 +1,6 @@ +import { Component } from "react"; +import { ColorPickerProps } from "react-color"; + +export type MaterialPickerProps = ColorPickerProps; + +export default class MaterialPicker extends Component {} diff --git a/react-color/lib/components/photoshop/Photoshop.d.ts b/react-color/lib/components/photoshop/Photoshop.d.ts new file mode 100644 index 0000000000..c3abaf0ccd --- /dev/null +++ b/react-color/lib/components/photoshop/Photoshop.d.ts @@ -0,0 +1,10 @@ +import { Component } from "react"; +import { ColorChangeHandler, ColorPickerProps } from "react-color"; + +export interface PhotoshopPickerProps extends ColorPickerProps { + header?: string; + onAccept?: ColorChangeHandler; + onCancel?: ColorChangeHandler; +} + +export default class PhotoshopPicker extends Component {} diff --git a/react-color/lib/components/sketch/Sketch.d.ts b/react-color/lib/components/sketch/Sketch.d.ts new file mode 100644 index 0000000000..229b2b2b51 --- /dev/null +++ b/react-color/lib/components/sketch/Sketch.d.ts @@ -0,0 +1,10 @@ +import { Component } from "react"; +import { ColorPickerProps } from "react-color"; + +export interface SketchPickerProps extends ColorPickerProps { + disableAlpha?: boolean; + presetColors?: string[]; + width?: string; +} + +export default class SketchPicker extends Component {} diff --git a/react-color/lib/components/slider/Slider.d.ts b/react-color/lib/components/slider/Slider.d.ts new file mode 100644 index 0000000000..913f30692a --- /dev/null +++ b/react-color/lib/components/slider/Slider.d.ts @@ -0,0 +1,6 @@ +import { Component } from "react"; +import { ColorPickerProps } from "react-color"; + +export type SliderPickerProps = ColorPickerProps; + +export default class SliderPicker extends Component {} diff --git a/react-color/lib/components/swatches/Swatches.d.ts b/react-color/lib/components/swatches/Swatches.d.ts new file mode 100644 index 0000000000..22e9d1704c --- /dev/null +++ b/react-color/lib/components/swatches/Swatches.d.ts @@ -0,0 +1,10 @@ +import { Component } from "react"; +import { ColorPickerProps } from "react-color"; + +export interface SwatchesPickerProps extends ColorPickerProps { + colors?: string[][]; + height?: number; + width?: number; +} + +export default class SwatchesPicker extends Component {} diff --git a/react-color/lib/components/twitter/Twitter.d.ts b/react-color/lib/components/twitter/Twitter.d.ts new file mode 100644 index 0000000000..b4e6bb2308 --- /dev/null +++ b/react-color/lib/components/twitter/Twitter.d.ts @@ -0,0 +1,6 @@ +import { Component } from "react"; +import { ColorPickerProps } from "react-color"; + +export type TwitterPickerProps = ColorPickerProps; + +export default class TwitterPicker extends Component {} diff --git a/react-color/react-color-tests.tsx b/react-color/react-color-tests.tsx index 7969047569..e4e6f2348b 100644 --- a/react-color/react-color-tests.tsx +++ b/react-color/react-color-tests.tsx @@ -5,16 +5,19 @@ import { AlphaPicker, BlockPicker, ChromePicker, CirclePicker, CompactPicker, GithubPicker, HuePicker, MaterialPicker, PhotoshopPicker, SketchPicker, SliderPicker, SwatchesPicker, - TwitterPicker, CustomPicker + TwitterPicker, CustomPicker, InjectedColorProps, ColorResult, + Color } from "react-color" import { Alpha, Checkboard, EditableInput, Hue, Saturation } from "react-color/lib/components/common" -interface CustomProps extends ReactColor.InjectedColorProps { - color?: ReactColor.Color +interface CustomProps extends InjectedColorProps { + color?: Color } var CustomComponent: StatelessComponent = (props: CustomProps) => { - function onChange (color: ReactColor.ColorResult) {} + function onChange (color: ColorResult) { + console.log(color) + } return (
diff --git a/react-color/tsconfig.json b/react-color/tsconfig.json index a88182ffbc..557f97eace 100644 --- a/react-color/tsconfig.json +++ b/react-color/tsconfig.json @@ -15,10 +15,12 @@ "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true, - "jsx": "react" + "jsx": "react", + "noUnusedParameters": true, + "noUnusedLocals": true }, "files": [ "index.d.ts", "react-color-tests.tsx" ] -} \ No newline at end of file +} diff --git a/react-color/tslint.json b/react-color/tslint.json new file mode 100644 index 0000000000..377cc837d4 --- /dev/null +++ b/react-color/tslint.json @@ -0,0 +1 @@ +{ "extends": "../tslint.json" } From d079ae2fee255e396756cff09912cd2c79da8d48 Mon Sep 17 00:00:00 2001 From: Karol Janyst Date: Mon, 13 Feb 2017 16:41:30 +0900 Subject: [PATCH 36/81] Add files to tsconfig --- react-color/tsconfig.json | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/react-color/tsconfig.json b/react-color/tsconfig.json index 557f97eace..26e01d85c6 100644 --- a/react-color/tsconfig.json +++ b/react-color/tsconfig.json @@ -21,6 +21,26 @@ }, "files": [ "index.d.ts", + "lib/components/alpha/Alpha.d.ts", + "lib/components/block/Block.d.ts", + "lib/components/chrome/Chrome.d.ts", + "lib/components/circle/Circle.d.ts", + "lib/components/common/Alpha.d.ts", + "lib/components/common/Checkboard.d.ts", + "lib/components/common/ColorWrap.d.ts", + "lib/components/common/EditableInput.d.ts", + "lib/components/common/Hue.d.ts", + "lib/components/common/index.d.ts", + "lib/components/common/Saturation.d.ts", + "lib/components/compact/Compact.d.ts", + "lib/components/github/Github.d.ts", + "lib/components/hue/Hue.d.ts", + "lib/components/material/Material.d.ts", + "lib/components/photoshop/Photoshop.d.ts", + "lib/components/sketch/Sketch.d.ts", + "lib/components/slider/Slider.d.ts", + "lib/components/swatches/Swatches.d.ts", + "lib/components/twitter/Twitter.d.ts", "react-color-tests.tsx" ] } From f78f7e2e533bdcedc1fccfcefd92b85d69b77026 Mon Sep 17 00:00:00 2001 From: Karol Janyst Date: Mon, 13 Feb 2017 17:02:28 +0900 Subject: [PATCH 37/81] Bring back ts 2.1 compile option --- react-color/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/react-color/index.d.ts b/react-color/index.d.ts index ca1b7a5f65..9448045a35 100644 --- a/react-color/index.d.ts +++ b/react-color/index.d.ts @@ -2,6 +2,7 @@ // Project: https://casesandberg.github.io/react-color/ // Definitions by: Karol Janyst // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import { ComponentClass, ClassAttributes, StatelessComponent, ReactNode } from "react"; From ce8ec50aab62c4d226d9ec61bcda989d5394c9ec Mon Sep 17 00:00:00 2001 From: Tommy Troy Lin Date: Mon, 13 Feb 2017 18:00:28 +0800 Subject: [PATCH 38/81] Update BannerPlugin definition Fix webpack/lib/BannerPlugin.js:19 Error: BannerPlugin only takes one argument (pass an options object) --- webpack/index.d.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/webpack/index.d.ts b/webpack/index.d.ts index 8b5a4d9938..f07630d869 100644 --- a/webpack/index.d.ts +++ b/webpack/index.d.ts @@ -654,7 +654,14 @@ declare namespace webpack { */ class BannerPlugin extends Plugin { - constructor(banner: any, options: any); + constructor(options: { + banner: string, + raw?: boolean, + entryOnly?: boolean, + test?: string | RegExp | Array, + include?: string | RegExp | Array, + exclude?: string | RegExp | Array + }); } class ContextReplacementPlugin extends Plugin { From affaaeb107d29ca122cd29568748a14264c62821 Mon Sep 17 00:00:00 2001 From: Tommy Troy Lin Date: Mon, 13 Feb 2017 18:46:39 +0800 Subject: [PATCH 39/81] Add myself to `Definitions by` --- webpack/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webpack/index.d.ts b/webpack/index.d.ts index f07630d869..696968719c 100644 --- a/webpack/index.d.ts +++ b/webpack/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for webpack 2.2 // Project: https://github.com/webpack/webpack -// Definitions by: Qubo , Matt Lewis , Benjamin Lim , Boris Cherny +// Definitions by: Qubo , Matt Lewis , Benjamin Lim , Boris Cherny , Tommy Troy Lin // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// From 592b7f26f90dc6013c43e9be2b0966fc11dbc42a Mon Sep 17 00:00:00 2001 From: Tommy Troy Lin Date: Mon, 13 Feb 2017 19:15:26 +0800 Subject: [PATCH 40/81] Update tests --- webpack/webpack-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webpack/webpack-tests.ts b/webpack/webpack-tests.ts index ffa69e90f2..7c47089e13 100644 --- a/webpack/webpack-tests.ts +++ b/webpack/webpack-tests.ts @@ -257,7 +257,7 @@ plugin = new webpack.IgnorePlugin(requestRegExp, contextRegExp); plugin = new webpack.PrefetchPlugin(context, request); plugin = new webpack.PrefetchPlugin(request); -plugin = new webpack.BannerPlugin(banner, options); +plugin = new webpack.BannerPlugin({ banner: 'banner' }); plugin = new webpack.optimize.DedupePlugin(); plugin = new webpack.optimize.LimitChunkCountPlugin(options); plugin = new webpack.optimize.MinChunkSizePlugin(options); From 95f59959eb3db2549f9495b1e85d5027e03c5f2d Mon Sep 17 00:00:00 2001 From: Alexey Date: Tue, 14 Feb 2017 01:37:12 +0300 Subject: [PATCH 41/81] Added TextFieldProps as a parent interface for AutoCompleteProps. AutoComplete component passes all the unknown properties to the underlying TextField component (see https://github.com/callemall/material-ui/blob/master/src/AutoComplete/AutoComplete.js#L507). The case I stumbled upon is using "disabled" property for AutoComplete. Although it is legit, existing typing does not allow to do that. --- material-ui/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/material-ui/index.d.ts b/material-ui/index.d.ts index c399116482..41e4c55cc1 100644 --- a/material-ui/index.d.ts +++ b/material-ui/index.d.ts @@ -533,7 +533,7 @@ declare namespace __MaterialUI { type cornersAndCenter = 'bottom-center' | 'bottom-left' | 'bottom-right' | 'top-center' | 'top-left' | 'top-right'; } - interface AutoCompleteProps { + interface AutoCompleteProps extends TextFieldProps { anchorOrigin?: propTypes.origin; animated?: boolean; animation?: React.ComponentClass; From ce3154548d2e629f4ecd39fa9e0d9ff0c7ba80bb Mon Sep 17 00:00:00 2001 From: pathanin Date: Tue, 14 Feb 2017 08:35:34 +0700 Subject: [PATCH 42/81] Add Expres.Request to verify function --- passport-facebook/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/passport-facebook/index.d.ts b/passport-facebook/index.d.ts index 4e84b4996b..d0843f6d3d 100644 --- a/passport-facebook/index.d.ts +++ b/passport-facebook/index.d.ts @@ -36,7 +36,7 @@ interface IStrategyOption { declare class Strategy implements passport.Strategy { constructor(options: IStrategyOption, - verify: (accessToken: string, refreshToken: string, profile: Profile, done: (error: any, user?: any, info?: any) => void) => void); + verify: (req?: express.Request, accessToken: string, refreshToken: string, profile: Profile, done: (error: any, user?: any, info?: any) => void) => void); name: string; authenticate: (req: express.Request, options?: Object) => void; } From f618ed02a28060cb3d979b00f12751d644332ab9 Mon Sep 17 00:00:00 2001 From: pathanin Date: Tue, 14 Feb 2017 08:52:34 +0700 Subject: [PATCH 43/81] Seperate method between passReqToCallback and normal way --- passport-facebook/index.d.ts | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/passport-facebook/index.d.ts b/passport-facebook/index.d.ts index d0843f6d3d..b9505f6e1f 100644 --- a/passport-facebook/index.d.ts +++ b/passport-facebook/index.d.ts @@ -31,12 +31,31 @@ interface IStrategyOption { scopeSeparator?: string; enableProof?: boolean; profileFields?: string[]; - passReqToCallback?: boolean; +} + +interface IStrategyOptionWithRequest { + clientID: string; + clientSecret: string; + callbackURL: string; + + scopeSeparator?: string; + enableProof?: boolean; + profileFields?: string[]; + passReqToCallback: boolean; +} + +interface VerifyFunction { + (accessToken: string, refreshToken: string, profile: Profile, done: (error: any, user?: any, info?: any) => void) => void): void; +} + +interface VerifyFunctionWithRequest { + (req: express.Request, accessToken: string, refreshToken: string, profile: Profile, done: (error: any, user?: any, info?: any) => void) => void): void; } declare class Strategy implements passport.Strategy { - constructor(options: IStrategyOption, - verify: (req?: express.Request, accessToken: string, refreshToken: string, profile: Profile, done: (error: any, user?: any, info?: any) => void) => void); - name: string; + constructor(options: IStrategyOptionWithRequest, verify: VerifyFunctionWithRequest); + constructor(options: IStrategyOption, verify: VerifyFunction); + + name: string; authenticate: (req: express.Request, options?: Object) => void; } From 0affd24555e3e671528852a821743b7b8fd0769e Mon Sep 17 00:00:00 2001 From: pathanin Date: Tue, 14 Feb 2017 08:59:17 +0700 Subject: [PATCH 44/81] Fixed tab space --- passport-facebook/index.d.ts | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/passport-facebook/index.d.ts b/passport-facebook/index.d.ts index b9505f6e1f..f60545ba06 100644 --- a/passport-facebook/index.d.ts +++ b/passport-facebook/index.d.ts @@ -34,28 +34,28 @@ interface IStrategyOption { } interface IStrategyOptionWithRequest { - clientID: string; - clientSecret: string; - callbackURL: string; - - scopeSeparator?: string; - enableProof?: boolean; - profileFields?: string[]; - passReqToCallback: boolean; + clientID: string; + clientSecret: string; + callbackURL: string; + + scopeSeparator?: string; + enableProof?: boolean; + profileFields?: string[]; + passReqToCallback: boolean; } interface VerifyFunction { - (accessToken: string, refreshToken: string, profile: Profile, done: (error: any, user?: any, info?: any) => void) => void): void; + (accessToken: string, refreshToken: string, profile: Profile, done: (error: any, user?: any, info?: any) => void) => void): void; } interface VerifyFunctionWithRequest { - (req: express.Request, accessToken: string, refreshToken: string, profile: Profile, done: (error: any, user?: any, info?: any) => void) => void): void; + (req: express.Request, accessToken: string, refreshToken: string, profile: Profile, done: (error: any, user?: any, info?: any) => void) => void): void; } declare class Strategy implements passport.Strategy { constructor(options: IStrategyOptionWithRequest, verify: VerifyFunctionWithRequest); - constructor(options: IStrategyOption, verify: VerifyFunction); + constructor(options: IStrategyOption, verify: VerifyFunction); - name: string; + name: string; authenticate: (req: express.Request, options?: Object) => void; } From 767cdfc00c03e941639790d53b1f72ad7e424127 Mon Sep 17 00:00:00 2001 From: Karol Janyst Date: Tue, 14 Feb 2017 11:10:35 +0900 Subject: [PATCH 45/81] Change project url --- react-color/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/react-color/index.d.ts b/react-color/index.d.ts index 9448045a35..798f44d6eb 100644 --- a/react-color/index.d.ts +++ b/react-color/index.d.ts @@ -1,5 +1,5 @@ // Type definitions for react-color 2.11 -// Project: https://casesandberg.github.io/react-color/ +// Project: https://github.com/casesandberg/react-color/ // Definitions by: Karol Janyst // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.1 From a4a53b97b8dcdf99173e3c0d5d9e463e71aae7a1 Mon Sep 17 00:00:00 2001 From: pathanin Date: Tue, 14 Feb 2017 09:21:18 +0700 Subject: [PATCH 46/81] Remove duplicate void --- passport-facebook/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/passport-facebook/index.d.ts b/passport-facebook/index.d.ts index f60545ba06..320a2169ba 100644 --- a/passport-facebook/index.d.ts +++ b/passport-facebook/index.d.ts @@ -45,11 +45,11 @@ interface IStrategyOptionWithRequest { } interface VerifyFunction { - (accessToken: string, refreshToken: string, profile: Profile, done: (error: any, user?: any, info?: any) => void) => void): void; + (accessToken: string, refreshToken: string, profile: Profile, done: (error: any, user?: any, info?: any) => void): void; } interface VerifyFunctionWithRequest { - (req: express.Request, accessToken: string, refreshToken: string, profile: Profile, done: (error: any, user?: any, info?: any) => void) => void): void; + (req: express.Request, accessToken: string, refreshToken: string, profile: Profile, done: (error: any, user?: any, info?: any) => void): void; } declare class Strategy implements passport.Strategy { From ad6ef1cd46e2011b0e17415d7857dabbe1424f64 Mon Sep 17 00:00:00 2001 From: Tommy Troy Lin Date: Tue, 14 Feb 2017 15:54:42 +0800 Subject: [PATCH 47/81] Update to comply with @bumbleblym' s suggestions --- webpack/index.d.ts | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/webpack/index.d.ts b/webpack/index.d.ts index 696968719c..9b80258479 100644 --- a/webpack/index.d.ts +++ b/webpack/index.d.ts @@ -654,14 +654,20 @@ declare namespace webpack { */ class BannerPlugin extends Plugin { - constructor(options: { - banner: string, - raw?: boolean, - entryOnly?: boolean, - test?: string | RegExp | Array, - include?: string | RegExp | Array, - exclude?: string | RegExp | Array - }); + constructor(options?: BannerPlugin.Options | string); + } + + namespace BannerPlugin { + type Filter = string | RegExp; + + interface Options { + banner?: string; + entryOnly?: boolean; + exclude?: Filter | Filter[]; + include?: Filter | Filter[]; + raw?: boolean; + test?: Filter | Filter[]; + } } class ContextReplacementPlugin extends Plugin { From ddc2a2f922fec2f872996106ca49f53e7f3fa82e Mon Sep 17 00:00:00 2001 From: Tommy Troy Lin Date: Tue, 14 Feb 2017 16:00:05 +0800 Subject: [PATCH 48/81] Update webpack-tests.ts --- webpack/webpack-tests.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/webpack/webpack-tests.ts b/webpack/webpack-tests.ts index 7c47089e13..9e07985544 100644 --- a/webpack/webpack-tests.ts +++ b/webpack/webpack-tests.ts @@ -257,7 +257,17 @@ plugin = new webpack.IgnorePlugin(requestRegExp, contextRegExp); plugin = new webpack.PrefetchPlugin(context, request); plugin = new webpack.PrefetchPlugin(request); -plugin = new webpack.BannerPlugin({ banner: 'banner' }); +plugin = new webpack.BannerPlugin('banner'); +plugin = new webpack.BannerPlugin(); +plugin = new webpack.BannerPlugin({}); +plugin = new webpack.BannerPlugin({ + banner: 'banner', + entryOnly: true, + exclude: /index/, + include: 'test', + raw: false, + test: ['test', /index/] +}); plugin = new webpack.optimize.DedupePlugin(); plugin = new webpack.optimize.LimitChunkCountPlugin(options); plugin = new webpack.optimize.MinChunkSizePlugin(options); From e4454f702e65b4ed8bf43802f5357f4d8b1753ab Mon Sep 17 00:00:00 2001 From: Tommy Troy Lin Date: Tue, 14 Feb 2017 16:40:09 +0800 Subject: [PATCH 49/81] Update index.d.ts --- webpack/index.d.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/webpack/index.d.ts b/webpack/index.d.ts index 9b80258479..da30f1151e 100644 --- a/webpack/index.d.ts +++ b/webpack/index.d.ts @@ -654,14 +654,14 @@ declare namespace webpack { */ class BannerPlugin extends Plugin { - constructor(options?: BannerPlugin.Options | string); + constructor(options: string | BannerPlugin.Options); } namespace BannerPlugin { type Filter = string | RegExp; - + interface Options { - banner?: string; + banner: string; entryOnly?: boolean; exclude?: Filter | Filter[]; include?: Filter | Filter[]; From d3b1b0ea6661c51baca622dac37dd1ca550d65f8 Mon Sep 17 00:00:00 2001 From: Tommy Troy Lin Date: Tue, 14 Feb 2017 16:41:34 +0800 Subject: [PATCH 50/81] Update webpack-tests.ts --- webpack/webpack-tests.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/webpack/webpack-tests.ts b/webpack/webpack-tests.ts index 9e07985544..d3f38e469e 100644 --- a/webpack/webpack-tests.ts +++ b/webpack/webpack-tests.ts @@ -258,8 +258,9 @@ plugin = new webpack.IgnorePlugin(requestRegExp, contextRegExp); plugin = new webpack.PrefetchPlugin(context, request); plugin = new webpack.PrefetchPlugin(request); plugin = new webpack.BannerPlugin('banner'); -plugin = new webpack.BannerPlugin(); -plugin = new webpack.BannerPlugin({}); +plugin = new webpack.BannerPlugin({ + banner: 'banner' +}); plugin = new webpack.BannerPlugin({ banner: 'banner', entryOnly: true, From 18c357d03c047de83e7db7e47721d43524e50ccc Mon Sep 17 00:00:00 2001 From: Patrick Lee Date: Tue, 14 Feb 2017 14:15:50 -0600 Subject: [PATCH 51/81] Allow for mapStateToProps to be undefined, make all arguments optional --- react-redux/index.d.ts | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/react-redux/index.d.ts b/react-redux/index.d.ts index 2d76aaac00..8daa310b51 100644 --- a/react-redux/index.d.ts +++ b/react-redux/index.d.ts @@ -49,14 +49,9 @@ export interface InferableComponentDecorator { export declare function connect(): InferableComponentDecorator; export declare function connect( - mapStateToProps: FuncOrSelf>, - mapDispatchToProps?: FuncOrSelf | MapDispatchToPropsObject> -): ComponentDecorator; - -export declare function connect( - mapStateToProps: FuncOrSelf>, - mapDispatchToProps: FuncOrSelf | MapDispatchToPropsObject>, - mergeProps: MergeProps, + mapStateToProps?: FuncOrSelf>, + mapDispatchToProps?: FuncOrSelf | MapDispatchToPropsObject>, + mergeProps?: MergeProps, options?: Options ): ComponentDecorator; From c2d6379c7c938a5365e69b549a16ffbcfff7dfee Mon Sep 17 00:00:00 2001 From: Patrick Lee Date: Tue, 14 Feb 2017 14:25:32 -0600 Subject: [PATCH 52/81] Add test for undefined mapStateToProps --- react-redux/react-redux-tests.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/react-redux/react-redux-tests.tsx b/react-redux/react-redux-tests.tsx index bbe84289ff..5d1f32765f 100644 --- a/react-redux/react-redux-tests.tsx +++ b/react-redux/react-redux-tests.tsx @@ -258,8 +258,9 @@ function mergeProps(stateProps: TodoState, dispatchProps: DispatchProps, ownProp connect(mapStateToProps2, actionCreators, mergeProps)(TodoApp); - - +//https://github.com/DefinitelyTyped/DefinitelyTyped/issues/14622#issuecomment-279820358 +//Allow for undefined mapStateToProps +connect(undefined, mapDispatchToProps6)(TodoApp); interface TestProp { property1: number; From 9290138941ca8dc14f165c0c6c52715482595462 Mon Sep 17 00:00:00 2001 From: Richard Date: Tue, 14 Feb 2017 17:38:52 -0300 Subject: [PATCH 53/81] Correct Meteor Status type --- meteor/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meteor/index.d.ts b/meteor/index.d.ts index e411947122..2bc358f251 100644 --- a/meteor/index.d.ts +++ b/meteor/index.d.ts @@ -604,7 +604,7 @@ declare namespace Meteor { function setTimeout(func: Function, delay: number): number; var settings: { public: {[id:string]: any}, private: {[id:string]: any}, [id:string]: any}; function startup(func: Function): void; - function status(): Meteor.StatusEnum; + function status(): DDP.DDPStatus; function subscribe(name: string, ...args: any[]): Meteor.SubscriptionHandle; function user(): Meteor.User; function userId(): string; From 7a9a6aa8c89fedd7d0331f58c3c9aeebe17744b4 Mon Sep 17 00:00:00 2001 From: Vasya Aksyonov Date: Wed, 15 Feb 2017 01:40:47 +0500 Subject: [PATCH 54/81] b_ typings and tests --- b_/b_-tests.ts | 52 ++++++++++++++++++++++++++++++++++++++++++++++++ b_/index.d.ts | 40 +++++++++++++++++++++++++++++++++++++ b_/tsconfig.json | 22 ++++++++++++++++++++ b_/tslint.json | 1 + 4 files changed, 115 insertions(+) create mode 100644 b_/b_-tests.ts create mode 100644 b_/index.d.ts create mode 100644 b_/tsconfig.json create mode 100644 b_/tslint.json diff --git a/b_/b_-tests.ts b/b_/b_-tests.ts new file mode 100644 index 0000000000..c0a92a4c7d --- /dev/null +++ b/b_/b_-tests.ts @@ -0,0 +1,52 @@ +import b_ = require("b_"); + +const blockClass: string = b_("block"); +const blockWithModsClass: string = b_("block", {stringMod: "string", boolMod: true, numberMod: 5}); +const elemClass: string = b_("block", "elem"); +const elemWithModsClass: string = b_("block", "elem", {stringMod: "string", boolMod: true, numberMod: 5}); + +const withBlock = b_.with("block"); +const withBlockClass: string = withBlock(); +const withBlockWithModsClass: string = withBlock({stringMod: "string", boolMod: true, numberMod: 5}); +const withBlockElemClass: string = withBlock("elem"); +const withBlockElemWithModsClass: string = withBlock("elem", {stringMod: "string", boolMod: true, numberMod: 5}); + +const lockBlock = b_.lock("block"); +const lockBlockClass: string = lockBlock(); +const lockBlockWithModsClass: string = lockBlock({stringMod: "string", boolMod: true, numberMod: 5}); +const lockBlockElemClass: string = lockBlock("elem"); +const lockBlockElemWithModsClass: string = lockBlock("elem", {stringMod: "string", boolMod: true, numberMod: 5}); + +const withElem = b_.with("block", "elem"); +const withElemClass: string = withElem(); +const withElemWithModsClass: string = withElem({stringMod: "string", boolMod: true, numberMod: 5}); + +const parameterizedB_ = b_.B({ + tailSpace: " ", + elementSeparator: "-", + modSeparator: "_", + modValueSeparator: "-", + classSeparator: " ", + isFullModifier: true +}); + +const parameterizedBlockClass: string = parameterizedB_("block"); +const parameterizedBlockWithModsClass: string = parameterizedB_("block", {stringMod: "string", boolMod: true, numberMod: 5}); +const parameterizedElemClass: string = parameterizedB_("block", "elem"); +const parameterizedElemWithModsClass: string = parameterizedB_("block", "elem", {stringMod: "string", boolMod: true, numberMod: 5}); + +const parameterizedWithBlock = parameterizedB_.with("block"); +const parameterizedWithBlockClass: string = parameterizedWithBlock(); +const parameterizedWithBlockWithModsClass: string = parameterizedWithBlock({stringMod: "string", boolMod: true, numberMod: 5}); +const parameterizedWithBlockElemClass: string = parameterizedWithBlock("elem"); +const parameterizedWithBlockElemWithModsClass: string = parameterizedWithBlock("elem", {stringMod: "string", boolMod: true, numberMod: 5}); + +const parameterizedLockBlock = parameterizedB_.lock("block"); +const parameterizedLockBlockClass: string = parameterizedLockBlock(); +const parameterizedLockBlockWithModsClass: string = parameterizedLockBlock({stringMod: "string", boolMod: true, numberMod: 5}); +const parameterizedLockBlockElemClass: string = parameterizedLockBlock("elem"); +const parameterizedLockBlockElemWithModsClass: string = parameterizedLockBlock("elem", {stringMod: "string", boolMod: true, numberMod: 5}); + +const parameterizedWithElem = parameterizedB_.with("block", "elem"); +const parameterizedWithElemClass: string = parameterizedWithElem(); +const parameterizedWithElemWithModsClass: string = parameterizedWithElem({stringMod: "string", boolMod: true, numberMod: 5}); diff --git a/b_/index.d.ts b/b_/index.d.ts new file mode 100644 index 0000000000..fe59f2d72e --- /dev/null +++ b/b_/index.d.ts @@ -0,0 +1,40 @@ +// Type definitions for b_ 1.3 +// Project: https://github.com/azproduction/b_ +// Definitions by: Vasya Aksyonov +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +interface Options { + tailSpace?: string; + elementSeparator?: string; + modSeparator?: string; + modValueSeparator?: string; + classSeparator?: string; + isFullModifier?: boolean; +} + +interface Mods { + [name: string]: any; +} + +interface Formatter { + (block: string, mods?: Mods): string; + (block: string, elem: string, mods?: Mods): string; + + with(block: string): BlockFormatter; + with(block: string, elem: string): ElemFormatter; + + lock(block: string): BlockFormatter; + lock(block: string, elem: string): ElemFormatter; + + B(options: Options): Formatter; +} + +interface BlockFormatter { + (mods?: Mods): string; + (elem: string, mods?: Mods): string; +} + +type ElemFormatter = (mods?: Mods) => string; + +declare const formatter: Formatter; +export = formatter; diff --git a/b_/tsconfig.json b/b_/tsconfig.json new file mode 100644 index 0000000000..5271d3aeeb --- /dev/null +++ b/b_/tsconfig.json @@ -0,0 +1,22 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "b_-tests.ts" + ] +} diff --git a/b_/tslint.json b/b_/tslint.json new file mode 100644 index 0000000000..2221e40e4a --- /dev/null +++ b/b_/tslint.json @@ -0,0 +1 @@ +{ "extends": "../tslint.json" } \ No newline at end of file From 7aaf957deb409060efc12dcafa001708f677cbb5 Mon Sep 17 00:00:00 2001 From: Omer Bokhari Date: Tue, 14 Feb 2017 17:08:01 -0800 Subject: [PATCH 55/81] remove author at their request --- redux-form/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/redux-form/index.d.ts b/redux-form/index.d.ts index b5b2d60de4..f36162d684 100644 --- a/redux-form/index.d.ts +++ b/redux-form/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for redux-form v6.3.3 // Project: https://github.com/erikras/redux-form -// Definitions by: Carson Full , Daniel Lytkin +// Definitions by: Carson Full // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.1 From 69c3d510d87d0ba467874f6008d635d236ef6199 Mon Sep 17 00:00:00 2001 From: Christian Treppo Date: Wed, 15 Feb 2017 15:44:20 +0100 Subject: [PATCH 56/81] [chai-enzyme] Add support for version 0.6.1 --- chai-enzyme/chai-enzyme-tests.tsx | 3 +++ chai-enzyme/index.d.ts | 20 +++++++++++++++++++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/chai-enzyme/chai-enzyme-tests.tsx b/chai-enzyme/chai-enzyme-tests.tsx index a70f7e7f96..1398db807d 100644 --- a/chai-enzyme/chai-enzyme-tests.tsx +++ b/chai-enzyme/chai-enzyme-tests.tsx @@ -40,5 +40,8 @@ expect(wrapper).to.have.data("test", "Test"); expect(wrapper).to.have.style("background", "green"); expect(wrapper).to.have.state("test", "test"); expect(wrapper).to.have.prop("test", 5); +expect(wrapper).to.have.props(["test1", "test2"]); +expect(wrapper).to.have.props({ test: 5 }); expect(wrapper).to.contain(); +expect(wrapper).to.containMatchingElement(); expect(wrapper).to.match(); diff --git a/chai-enzyme/index.d.ts b/chai-enzyme/index.d.ts index 6997abd5fe..0d9eb2994f 100644 --- a/chai-enzyme/index.d.ts +++ b/chai-enzyme/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for chai-enzyme 0.5.0 +// Type definitions for chai-enzyme 0.6.1 // Project: https://github.com/producthunt/chai-enzyme // Definitions by: Alexey Svetliakov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -39,6 +39,12 @@ declare namespace Chai { */ className(name: string): Assertion; + /** + * Assert that the wrapper contains a certain element: + * @param selector + */ + containMatchingElement(selector: EnzymeSelector): Assertion; + /** * Assert that the wrapper contains a descendant matching the given selector: * @param selector @@ -140,6 +146,18 @@ declare namespace Chai { * @param val */ prop(key: string, val?: any): Assertion; + + /** + * Assert that the wrapper has given props [with values]: + * @param keys + */ + props(keys: string[]): Assertion; + + /** + * Assert that the wrapper has given props [with values]: + * @param props + */ + props(props: EnzymeSelector): Assertion; } } From da3675c10789765d367117e4c6814477ea440cbb Mon Sep 17 00:00:00 2001 From: Cheng Ly Date: Wed, 15 Feb 2017 10:40:57 -0800 Subject: [PATCH 57/81] Update react-bootstrap typings for ResponsiveEmbed --- react-bootstrap/index.d.ts | 11 ++++++++++- react-bootstrap/react-bootstrap-tests.tsx | 16 +++++++++++++++- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/react-bootstrap/index.d.ts b/react-bootstrap/index.d.ts index e211264bc7..66291b8c43 100644 --- a/react-bootstrap/index.d.ts +++ b/react-bootstrap/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for react-bootstrap // Project: https://github.com/react-bootstrap/react-bootstrap -// Definitions by: Walker Burgin , Vincent Siao , Danilo Barros , Batbold Gansukh , Raymond May Jr. +// Definitions by: Walker Burgin , Vincent Siao , Danilo Barros , Batbold Gansukh , Raymond May Jr. , Cheng Sieu Ly // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.1 @@ -866,6 +866,15 @@ declare namespace ReactBootstrap { type Image = React.ClassicComponent; var Image: React.ClassicComponentClass; + // + interface ResponsiveEmbedProps extends React.HTMLProps { + a16by9?: boolean; + a4by3?: boolean; + bsClass?: string; + } + class ResponsiveEmbed extends React.Component { + } + // interface PageHeaderProps extends React.HTMLProps { } diff --git a/react-bootstrap/react-bootstrap-tests.tsx b/react-bootstrap/react-bootstrap-tests.tsx index 00bfae517c..afad1f820d 100644 --- a/react-bootstrap/react-bootstrap-tests.tsx +++ b/react-bootstrap/react-bootstrap-tests.tsx @@ -14,7 +14,7 @@ import { Nav, NavItem, Navbar, NavDropdown, Tabs, Tab, Pager, PageItem, Pagination, Alert, Carousel, SafeAnchor, - Grid, Row, Col, Thumbnail, Image, + Grid, Row, Col, Thumbnail, Image, ResponsiveEmbed, Label, Badge, Jumbotron, PageHeader, Glyphicon, Table, Form, FormGroup, ControlLabel, FormControl, HelpBlock, @@ -845,6 +845,20 @@ export class ReactBootstrapTest extends Component {
+
+
+ + Embedded Content + + + Embedded Content + + + Embedded Content + +
+
+
Example page header Subtext for header
From 189a51cd2c5ffbd8eca9e96c9c46dbb12a6a32d1 Mon Sep 17 00:00:00 2001 From: Anton Konev Date: Thu, 16 Feb 2017 16:26:39 +0300 Subject: [PATCH 58/81] add raven-js to not needed packages --- notNeededPackages.json | 8 +- raven-js/index.d.ts | 338 ------------------------------------- raven-js/raven-js-tests.ts | 61 ------- raven-js/tsconfig.json | 23 --- 4 files changed, 7 insertions(+), 423 deletions(-) delete mode 100644 raven-js/index.d.ts delete mode 100644 raven-js/raven-js-tests.ts delete mode 100644 raven-js/tsconfig.json diff --git a/notNeededPackages.json b/notNeededPackages.json index 0cd56b96d1..a7db12a6bf 100644 --- a/notNeededPackages.json +++ b/notNeededPackages.json @@ -305,6 +305,12 @@ "typingsPackageName": "gaea-model", "sourceRepoURL": "https://github.com/ascoders/gaea-model", "asOfVersion": "0.0.0" + }, + { + "libraryName": "Raven JS", + "typingsPackageName": "raven-js", + "sourceRepoURL": "https://github.com/getsentry/raven-js", + "asOfVersion": "3.10.0" } ] -} +} \ No newline at end of file diff --git a/raven-js/index.d.ts b/raven-js/index.d.ts deleted file mode 100644 index 7b54ec7372..0000000000 --- a/raven-js/index.d.ts +++ /dev/null @@ -1,338 +0,0 @@ -// Type definitions for Raven.js -// Project: https://github.com/getsentry/raven-js -// Definitions by: Santi Albo , Benjamin Pannell , Gary Blackwood , Rich Rout , Ben Vinegar , Ilya Pirogov , Eli White , David Cramer , Connor Peet , comaz , Luca Vazzano -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - - -declare let Raven: RavenStatic; -export default Raven; - -interface RavenStatic { - /** Raven.js version. */ - VERSION: string; - - /** A list of currently active plugins. */ - Plugins: { [id: string]: RavenPlugin }; - - /** - * Allow Raven to be configured as soon as it is loaded. - * It uses a global RavenConfig = {dsn: '...', config: {}} - */ - afterLoad(): void; - - /** - * Allow multiple versions of Raven to be installed. - * Strip Raven from the global context and returns the instance. - */ - noConflict(): RavenStatic; - - /** - * Configure Raven with a DSN and extra options - * - * @param dsn The public Sentry DSN - * @param options Optional set of of global options - */ - config(dsn: string, options?: RavenGlobalOptions): RavenStatic; - - /** - * Set the DSN (can be called multiple times, unlike config) - * - * @param dsn The public Sentry DSN - */ - setDSN(dsn: string): RavenStatic; - - /** - * Installs a global window.onerror error handler to capture and report uncaught exceptions. - * At this point, install() is required to be called due to the way TraceKit is set up. - */ - install(): RavenStatic; - - /** - * Adds a plugin to Raven - */ - addPlugin(plugin: RavenPlugin, ...pluginArgs: any[]): RavenStatic; - - /** - * Wrap code within a context so Raven can capture errors reliably across domains that is - * executed immediately. - * - * @param options A specific set of options for this context - * @param func The callback to be immediately executed within the context - * @param args An array of arguments to be called with the callback - */ - context(func: Function, ...args: any[]): void; - context(options: RavenWrapOptions, func: Function, ...args: any[]): void; - - /** - * Wrap code within a context and returns back a new function to be executed - * - * @param options A specific set of options for this context - * @param func The function to be wrapped in a new context - * @return The newly wrapped functions with a context - */ - wrap(func: Function): Function; - wrap(options: RavenWrapOptions, func: Function): Function; - wrap(func: T): T; - wrap(options: RavenWrapOptions, func: T): T; - - /** - * Uninstalls the global error handler. - */ - uninstall(): RavenStatic; - - /** - * Manually capture an exception and send it over to Sentry - * - * @param ex An exception to be logged - * @param options A specific set of options for this error - */ - captureException(ex: Error, options?: RavenOptions): RavenStatic; - - /* - * Manually send a message to Sentry - * - * @param msg A plain message to be captured in Sentry - * @param options A specific set of options for this message - */ - captureMessage(msg: string, options?: RavenOptions): RavenStatic; - - /** - * Add a breadcrumb - * @param crumb The trail which should be added to the trail - */ - captureBreadcrumb(crumb: RavenBreadcrumb): RavenStatic; - - /** - * Set a user to be sent along with payloads. - * - * @param user The definition of the currently active user's unique identity - */ - setUserContext(user: RavenUserContext): RavenStatic; - - /** - * Clear the user context, removing the user data that would be sent to Sentry. - */ - setUserContext(): RavenStatic; - - /** - * Add arbitrary data to be sent along with the payload. - * @param extra data of an arbitrary, nested type which will be added - */ - setExtraContext(extra: { [prop: string]: any }): RavenStatic; - - /** - * Add additional tags to be sent along with payloads. - * @param tags A key/value-pair which will be added - */ - setTagsContext(tags: { [id: string]: string }): RavenStatic; - - /** - * Clear the whole currently set context. - */ - clearContext(): RavenStatic; - - /** - * Get a copy of the current context. - */ - getContext(): Object; - - /** - * Set environment of application - * @param environment Typically something like 'production' - */ - setEnvironment(environment: string): RavenStatic; - - /** - * Set release version of application - * @param release Typically something like a git SHA to identify the current version - */ - setRelease(release: string): RavenStatic; - - /** - * Specify a function that can mutate the payload right before it is being sent to Sentry. - * @param callback The function which can mutate the data - */ - setDataCallback(callback: (data: any, orig?: string) => any): RavenStatic; - - /** - * Specify a callback function that can mutate or filter breadcrumbs when they are captured. - * @param callback The function which applies the filter - */ - setBreadcrumbCallback(callback :(data: any, orig?: string) => any): RavenStatic; - - /** - * Specify a callback function that determines if the given message should be sent to Sentry. - * @param callback The function which determines if the given blob should be sent - */ - setShouldSendCallback(callback: (data: any, orig?: string) => boolean): RavenStatic; - - /** - * Override the default HTTP data transport handler. - * @param transport The function which will be invoked to handle the data transmission - */ - setTransport(transport: (options: RavenTransportOptions) => void): RavenStatic; - - /** - * Get the latest raw exception that was captured by Raven. - */ - lastException(): Error; - - /** - * Get the ID of the last Event captured by Raven. - */ - lastEventId(): string; - - /** - * Determine if Raven is setup and ready to go. - */ - isSetup(): boolean; - - /** - * Show the User Feedback Dialog of Sentry - * @param RavenReportDialogOptions Optional Options to set for the User Feedback - */ - showReportDialog(options?: RavenReportDialogOptions): void; -} - - -// --- Helper Interfaces for Options -------------- -export interface RavenBreadcrumOptions { - /** Whether to collect XHR calls, defaults to true */ - xhr?: boolean; - - /** Whether to collect console logs, defaults to true */ - console?: boolean; - - /** Whether to collect dom events, defaults to true */ - dom?: boolean; - - /** Whether to record window location and navigation, defaults to true */ - location?: boolean; -} - -export interface CommonRavenOptions { - /** The environment of the application you are monitoring with Sentry */ - environment?: string; - - /** The release version of the application you are monitoring with Sentry */ - release?: string; - - /** Additional key/value-data to be tagged onto the error. */ - tags?: { [id: string]: string }; - - /** Additional, arbitrary metadata to collect */ - extra?: { [prop: string]: any }; - - /** The name of the logger used by Sentry. Default: javascript */ - logger?: string; - - /** set to true to get the strack trace of your message */ - stacktrace?: boolean; -} - -export interface RavenOptions extends CommonRavenOptions { - /** The name of the server or device that the client is running on */ - server_name?: string; - - /** The log level associated with this event. Default: error */ - level?: string; - - /** In some cases you may see issues where Sentry groups multiple events together when they - * should be separate entities. In other cases, Sentry simply doesn’t group events together - * because they’re so sporadic that they never look the same. */ - fingerprint?: string[]; - - /** Number of frames to trim off the stacktrace. Default: 1 */ - trimHeadFrames?: number; - - /** The name of the device platform. Default: "javascript" */ - platform?: string; -} - -export interface RavenGlobalOptions extends CommonRavenOptions { - /** The name of the server or device that the client is running on */ - serverName?: string; - - /** Configures which breadcrumbs are collected automatically */ - autoBreadcrumbs?: boolean | RavenBreadcrumOptions; - - /** Whether to collect errors on the window via TraceKit.collectWindowErrors. Default: true. */ - collectWindowErrors?: boolean; - - /** Max number of breadcrumbs to collect. Default: 100 */ - maxBreadcrumbs?: number; - - /** Exclude messages which match one of the given RegEx-Patterns from being sent to Sentry. */ - ignoreErrors?: (RegExp | string)[]; - - /** Exclude messages which come from whole urls matching one of the given RegEx patterns. */ - ignoreUrls?: (RegExp | string)[]; - - /** Only report messages which come from whole urls matching one of the given RegEx patterns. */ - whitelistUrls?: (RegExp | string)[]; - - /** An array of RegEx patterns to indicate which urls are a part of your app. */ - includePaths?: (RegExp | string)[]; - - /** Maximum amount of stack frames to collect. Default: Infinity */ - stackTraceLimit?: number; - - /** Override the default HTTP data transport handler. */ - transport?: (options: RavenTransportOptions) => void; - - /** Limit the maxium length of a message to this number of characters. Default: Infinity */ - maxMessageLength?: number; - - /** Allows you to apply your own filters to determine if the message should be sent to Sentry. */ - shouldSendCallback?: (data: any) => boolean; - - /** A function which allows mutation of the data payload right before being sent to Sentry */ - dataCallback?: (data: any) => any; -} - -export interface RavenWrapOptions extends RavenOptions { - /** Whether to run the wrap recursively. Default: false. */ - deep?: boolean; -} - -export interface RavenTransportOptions { - url: string; - data: any; - auth: { - sentry_version: string; - sentry_client: string; - sentry_key: string; - }; - onSuccess: () => void; - onFailure: () => void; -} - -export interface RavenReportDialogOptions { - eventId?: number, - dsn?: string, - user?: { - name?: string, - email?: string - } -} - - -// --- Helper Interfaces for complex Data Structures -------------- -export interface RavenPlugin { - (raven: RavenStatic, ...args: any[]): RavenStatic; -} - -export interface RavenUserContext { - id?: string; - username?: string; - email?: string; - ip_address?: string; - extra?: { [prop: string]: any }; -} - -export interface RavenBreadcrumb { - message: string; - data: { [id: string]: string }; - category: string; - level: string; -} diff --git a/raven-js/raven-js-tests.ts b/raven-js/raven-js-tests.ts deleted file mode 100644 index bbd3285e1e..0000000000 --- a/raven-js/raven-js-tests.ts +++ /dev/null @@ -1,61 +0,0 @@ -import RavenJS from 'raven-js'; - -RavenJS.config('https://public@getsentry.com/1').install(); - - -RavenJS.config( - 'https://public@getsentry.com/1', - { - logger: 'my-logger', - ignoreUrls: [ - /graph\.facebook\.com/i - ], - ignoreErrors: [ - 'fb_xd_fragment' - ], - includePaths: [ - /https?:\/\/(www\.)?getsentry\.com/, - /https?:\/\/d3nslu0hdya83q\.cloudfront\.net/ - ] - } -).install(); - -var throwsError = () => { - throw new Error('broken'); -}; - -try { - throwsError(); -} catch(e) { - RavenJS.captureException(e); - RavenJS.captureException(e, {tags: { key: "value" }}); -} - -RavenJS.context(throwsError); -RavenJS.context({tags: { key: "value" }}, throwsError); -RavenJS.context({extra: {planet: {name: 'Earth'}}}, throwsError); - -setTimeout(RavenJS.wrap(throwsError), 1000); -RavenJS.wrap({logger: "my.module"}, throwsError)(); -RavenJS.wrap({tags: {git_commit: 'c0deb10c4'}}, throwsError)(); - -RavenJS.setUserContext({ - email: 'matt@example.com', - id: '123' -}); - -RavenJS.captureMessage('Broken!'); -RavenJS.captureMessage('Broken!', {tags: { key: "value" }}); - -RavenJS.showReportDialog({ - eventId: 0815, - dsn:'1337asdf', - user: { - name: 'DefenitelyTyped', - email: 'df@ts.ms' - } -}); - -RavenJS.setTagsContext({ key: "value" }); - -RavenJS.setExtraContext({ foo: "bar" }); diff --git a/raven-js/tsconfig.json b/raven-js/tsconfig.json deleted file mode 100644 index 9b2f3354cf..0000000000 --- a/raven-js/tsconfig.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6", - "dom" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": false, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "raven-js-tests.ts" - ] -} \ No newline at end of file From 3f5ec8ac4a600bedc72f9edbde2f8497a143cd8e Mon Sep 17 00:00:00 2001 From: Andy Hanson Date: Thu, 16 Feb 2017 06:29:56 -0800 Subject: [PATCH 59/81] proj4: Lint and convert to external module --- proj4/index.d.ts | 125 ++++++++++++++++--------------------------- proj4/proj4-tests.ts | 38 ++++++------- proj4/tslint.json | 1 + 3 files changed, 65 insertions(+), 99 deletions(-) create mode 100644 proj4/tslint.json diff --git a/proj4/index.d.ts b/proj4/index.d.ts index d59063f51b..ff2b8334de 100644 --- a/proj4/index.d.ts +++ b/proj4/index.d.ts @@ -1,102 +1,67 @@ -// Type definitions for proj4 2.3.15 +// Type definitions for proj4 2.3 // Project: https://github.com/proj4js/proj4js // Definitions by: Denis Carriere // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -declare module "proj4" { - const TemplateCoordinates: Array | InterfaceCoordinates; +declare namespace proj4 { + type TemplateCoordinates = number[] | InterfaceCoordinates; interface InterfaceCoordinates { - x: number, - y: number, - z?: number, - m?: number + x: number; + y: number; + z?: number; + m?: number; } interface InterfaceDatum { - datum_type: number - a: number - b: number - es: number - ep2: number + datum_type: number; + a: number; + b: number; + es: number; + ep2: number; } - interface Proj4Static { - forward(coordinates: typeof TemplateCoordinates): Array - inverse(coordinates: typeof TemplateCoordinates): Array + interface Static { + forward(coordinates: TemplateCoordinates): number[]; + inverse(coordinates: TemplateCoordinates): number[]; } interface InterfaceProjection { - datum: string - b: number - rf: number - sphere: number - es: number - e: number - ep2: number - forward(coordinates: typeof TemplateCoordinates): Array - inverse(coordinates: typeof TemplateCoordinates): Array + datum: string; + b: number; + rf: number; + sphere: number; + es: number; + e: number; + ep2: number; + forward(coordinates: TemplateCoordinates): number[]; + inverse(coordinates: TemplateCoordinates): number[]; } - namespace proj4 { - /** - * @name defaultDatum - */ - export const defaultDatum: string; + export const defaultDatum: string; - /** - * @name Proj - */ - export function Proj(srsCode:any, callback?: any): InterfaceProjection; - - /** - * @name WGS84 - */ - export const WGS84: any; + export function Proj(srsCode: any, callback?: any): InterfaceProjection; - /** - * Depecrated v3 - * @name Point - */ - export function Point(x: number, y: number, z?: number): InterfaceCoordinates; - export function Point(coordinates: Array): InterfaceCoordinates; - export function Point(coordinates: InterfaceCoordinates): InterfaceCoordinates; - export function Point(coordinates: string): InterfaceCoordinates; - - /** - * @name toPoint - */ - export function toPoint(array: Array): InterfaceCoordinates; - - /** - * @name defs - */ - export function defs(name: string): any; - export function defs(name: string, projection: string): any; - export function defs(name: Array>): any; - - /** - * @name transform - */ - export function transform(source: InterfaceProjection, dest: InterfaceProjection, point: typeof TemplateCoordinates): any; - - /** - * @name mgrs - */ - export function mgrs(coordinates: Array, accuracy: number): string; - - /** - * @name version - */ - export const version: string; - } + export const WGS84: any; /** - * @name proj4 + * Depecrated v3 */ - function proj4(fromProjection: string): Proj4Static; - function proj4(fromProjection: string, toProjection: string): Proj4Static; - function proj4(fromProjection: string, coordinates: typeof TemplateCoordinates): Array; - function proj4(fromProjection: string, toProjection: string, coordinates: typeof TemplateCoordinates): Array; - export = proj4 + export function Point(x: number, y: number, z?: number): InterfaceCoordinates; + export function Point(coordinates: TemplateCoordinates | string): InterfaceCoordinates; + + export function toPoint(array: number[]): InterfaceCoordinates; + + export function defs(name: string, projection?: string): any; + export function defs(name: string[][]): any; + + export function transform(source: InterfaceProjection, dest: InterfaceProjection, point: TemplateCoordinates): any; + + export function mgrs(coordinates: number[], accuracy: number): string; + + export const version: string; } + +declare function proj4(fromProjection: string, toProjection?: string, coordinates?: proj4.TemplateCoordinates): proj4.Static; +declare function proj4(fromProjection: string, coordinates: proj4.TemplateCoordinates): number[]; +export = proj4; diff --git a/proj4/proj4-tests.ts b/proj4/proj4-tests.ts index 72fa804c6e..2c658b8f24 100644 --- a/proj4/proj4-tests.ts +++ b/proj4/proj4-tests.ts @@ -1,49 +1,49 @@ -import * as proj4 from 'proj4' +import * as proj4 from 'proj4'; /////////////////////////////////////////// // Tests data initialisation /////////////////////////////////////////// -const name = 'WGS84' +const name = 'WGS84'; const epsg = { 4269: '+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees', 4326: '+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees', -} -const point1 = [-71, 41] -const point2 = {x: 2, y: 5} -const mgrs = "24XWT783908" +}; +const point1 = [-71, 41]; +const point2 = {x: 2, y: 5}; +const mgrs = "24XWT783908"; /////////////////////////////////////////// // Tests Measurement /////////////////////////////////////////// -proj4(epsg['4269'], epsg['4326'], point1) -proj4(epsg['4269'], point1) -proj4(epsg['4269'], epsg['4326']).forward(point2) -proj4(epsg['4269'], epsg['4326']).inverse(point2) +proj4(epsg['4269'], epsg['4326'], point1); +proj4(epsg['4269'], point1); +proj4(epsg['4269'], epsg['4326']).forward(point2); +proj4(epsg['4269'], epsg['4326']).inverse(point2); /////////////////////////////////// // Named Projections /////////////////////////////////// -proj4.defs('WGS84', epsg['4326']) +proj4.defs('WGS84', epsg['4326']); proj4.defs([ ['EPSG:4326', epsg['4326']], ['EPSG:4269', epsg['4269']] -]) -proj4.defs('urn:x-ogc:def:crs:EPSG:4326', proj4.defs('EPSG:4326')) +]); +proj4.defs('urn:x-ogc:def:crs:EPSG:4326', proj4.defs('EPSG:4326')); /////////////////////////////////// // Utils /////////////////////////////////// // WGS84 -proj4.WGS84 +proj4.WGS84; // Proj -proj4.Proj('WGS84') +proj4.Proj('WGS84'); // toPoint -proj4.toPoint([1, 2]) -proj4.toPoint([1, 2, 3]) -proj4.toPoint([1, 2, 3, 4]) +proj4.toPoint([1, 2]); +proj4.toPoint([1, 2, 3]); +proj4.toPoint([1, 2, 3, 4]); // Point // WARNING: Deprecated in v3 -proj4.Point([1, 2, 3, 4]) \ No newline at end of file +proj4.Point([1, 2, 3, 4]); \ No newline at end of file diff --git a/proj4/tslint.json b/proj4/tslint.json new file mode 100644 index 0000000000..2221e40e4a --- /dev/null +++ b/proj4/tslint.json @@ -0,0 +1 @@ +{ "extends": "../tslint.json" } \ No newline at end of file From c9c851f87518c8c24ab786453c681b765b1f6173 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20S=C3=A1nchez?= Date: Thu, 16 Feb 2017 09:36:56 -0600 Subject: [PATCH 60/81] Tedious connection pool extends node's EventEmitter --- tedious-connection-pool/index.d.ts | 35 +++++-------------- .../tedious-connection-pool-tests.ts | 6 ++++ tedious-connection-pool/tslint.json | 3 ++ 3 files changed, 17 insertions(+), 27 deletions(-) create mode 100644 tedious-connection-pool/tslint.json diff --git a/tedious-connection-pool/index.d.ts b/tedious-connection-pool/index.d.ts index d9334f74cd..7d144bfc22 100644 --- a/tedious-connection-pool/index.d.ts +++ b/tedious-connection-pool/index.d.ts @@ -1,14 +1,14 @@ -// Type definitions for tedious-connection-pool +// Type definitions for tedious-connection-pool 1.0 // Project: https://github.com/pekim/tedious-connection-pool // Definitions by: Cyprien Autexier // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -/// +/// +import events = require('events'); import tedious = require('tedious'); declare namespace tcp { - /** * Extends Tedious Connection with release function */ @@ -20,22 +20,16 @@ declare namespace tcp { } /** - * Acquire function callback signature + * Provides a connection or an error + * @param err error if any + * @param connection issued from the pool */ - export interface ConnectionCallback { - /** - * Provides a connection or an error - * @param err error if any - * @param connection issued from the pool - */ - (err: Error, connection: PooledConnection): void; - } + export type ConnectionCallback = (err: Error, connection: PooledConnection) => void; /** * Pool Configuration interface */ export interface PoolConfig { - /** * Minimum concurrent connections */ @@ -66,15 +60,12 @@ declare namespace tcp { */ acquireTimeout?: number; } - - } /** * Tedious Connection Pool Class */ -declare class tcp { - +declare class tcp extends events.EventEmitter { /** * Connection Pool constructor * @param poolConfig the pool configuration @@ -88,20 +79,10 @@ declare class tcp { */ acquire(callback: tcp.ConnectionCallback): void; - /** - * listens for a specific connection pool event - * @param event the event name - * @param callback invoked when the event is raised - */ - on(event: string, callback: Function): void; - /** * closes opened connections */ drain(): void; } - - - export = tcp; diff --git a/tedious-connection-pool/tedious-connection-pool-tests.ts b/tedious-connection-pool/tedious-connection-pool-tests.ts index 31715e2090..bdf504274a 100644 --- a/tedious-connection-pool/tedious-connection-pool-tests.ts +++ b/tedious-connection-pool/tedious-connection-pool-tests.ts @@ -30,6 +30,12 @@ pool.on('error', (err: Error) => { console.error(err); }); +pool.once('error', (err: Error) => { + console.error(err); +}); + +pool.removeAllListeners(); + pool.acquire((err: Error, connection: ConnectionPool.PooledConnection) =>{ console.log("hurray"); connection.beginTransaction((error: Error): void => {}, "some name"); diff --git a/tedious-connection-pool/tslint.json b/tedious-connection-pool/tslint.json new file mode 100644 index 0000000000..f9e30021f4 --- /dev/null +++ b/tedious-connection-pool/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "../tslint.json" +} From 83f4d4558a79089ac9a9b980792cac30eaaea888 Mon Sep 17 00:00:00 2001 From: Kay Schecker Date: Mon, 20 Feb 2017 10:00:11 +0100 Subject: [PATCH 61/81] Added pkcs12 typings --- node-forge/index.d.ts | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/node-forge/index.d.ts b/node-forge/index.d.ts index 8640f699d4..893a96d48e 100644 --- a/node-forge/index.d.ts +++ b/node-forge/index.d.ts @@ -1,6 +1,7 @@ // Type definitions for node-forge 0.6.42 // Project: https://github.com/digitalbazaar/forge // Definitions by: Seth Westphal +// Kay Schecker // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare module "node-forge" { @@ -23,6 +24,7 @@ declare module "node-forge" { function privateKeyToPem(key: Key, maxline?: number): PEM; function publicKeyToPem(key: Key, maxline?: number): PEM; + function certificateToPem(cert: Certificate, maxline?: number): PEM; interface oids { [key: string]: string; @@ -234,4 +236,39 @@ declare module "node-forge" { } } } + + namespace pkcs12 { + + interface BagsFilter { + localKeyId?: string; + localKeyIdHex?: string; + friendlyName?: string; + bagType?: string; + } + + interface Bag { + type: string; + attributes: any; + key?: pki.Key; + cert?: pki.Certificate; + asn1: asn1.Asn1 + } + + interface Pkcs12Pfx { + version: string; + safeContents: [{ + encrypted: boolean; + safeBags: Bag[]; + }]; + getBags: (filter: BagsFilter) => { + [key: string]: Bag[]; + localKeyId?: Bag[]; + friendlyName?: Bag[]; + }; + getBagsByFriendlyName: (fiendlyName: string, bagType: string) => Bag[] + getBagsByLocalKeyId: (localKeyId: string, bagType: string) => Bag[] + } + + function pkcs12FromAsn1(obj:any, strictOrPassword: boolean|string, password?: string) : Pkcs12Pfx; + } } From 8bc9b14ca9db56afb7a7ce7b60a29c93ec165b0d Mon Sep 17 00:00:00 2001 From: Kay Schecker Date: Tue, 21 Feb 2017 08:41:00 +0100 Subject: [PATCH 62/81] Use function overloading instead of a single function --- node-forge/index.d.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/node-forge/index.d.ts b/node-forge/index.d.ts index 893a96d48e..900fdfc2f9 100644 --- a/node-forge/index.d.ts +++ b/node-forge/index.d.ts @@ -269,6 +269,7 @@ declare module "node-forge" { getBagsByLocalKeyId: (localKeyId: string, bagType: string) => Bag[] } - function pkcs12FromAsn1(obj:any, strictOrPassword: boolean|string, password?: string) : Pkcs12Pfx; + function pkcs12FromAsn1(obj:any, strict?: boolean, password?: string) : Pkcs12Pfx; + function pkcs12FromAsn1(obj:any, password?: string) : Pkcs12Pfx; } } From 23cfd3e510709aff50e42ab3c7fec666108716e4 Mon Sep 17 00:00:00 2001 From: Terry Bayne Date: Thu, 23 Feb 2017 12:39:17 -0600 Subject: [PATCH 63/81] Updated typings for the react-autosuggest package Reformatted to remove whitespace errors Fixed the comment header --- react-autosuggest/index.d.ts | 25 +- react-autosuggest/react-autosuggest-tests.tsx | 418 ++++++++++-------- 2 files changed, 257 insertions(+), 186 deletions(-) diff --git a/react-autosuggest/index.d.ts b/react-autosuggest/index.d.ts index d0d6bec839..d028e0b595 100644 --- a/react-autosuggest/index.d.ts +++ b/react-autosuggest/index.d.ts @@ -1,11 +1,18 @@ // Type definitions for react-autosuggest 7.0 // Project: http://react-autosuggest.js.org/ -// Definitions by: Nicolas Schmitt , Philip Ottesen , Robert Essig +// Definitions by: Nicolas Schmitt , Philip Ottesen , Robert Essig , Terry Bayne // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.1 -import * as React from 'react'; +/* tslint:disable:dt-header */ +import * as React from 'react'; +declare class Autosuggest extends React.Component {} + +export = Autosuggest; +export as namespace Autosuggest; + +declare namespace Autosuggest { interface SuggestionsFetchRequest { value: string; reason: string; @@ -25,13 +32,13 @@ import * as React from 'react'; focusedSuggestion: any; } - interface InputProps extends React.HTMLAttributes { + interface InputProps extends React.HTMLAttributes { value: string; - onChange: (event: React.FormEvent, params?: ChangeEvent) => void; - onBlur?: (event: React.FormEvent, params?: BlurEvent) => void; + onChange: (event: React.FormEvent , params?: ChangeEvent) => void; + onBlur?: (event: React.FormEvent , params?: BlurEvent) => void; } - export interface SuggestionSelectedEventData { + export interface SuggestionSelectedEventData { method: 'click' | 'enter'; sectionIndex: number | null; suggestion: TSuggestion; @@ -50,14 +57,14 @@ import * as React from 'react'; suggestionsContainer?: string; } - interface AutosuggestProps extends React.Props { + interface AutosuggestProps extends React.Props < Autosuggest > { suggestions: any[]; onSuggestionsFetchRequested: (request: SuggestionsFetchRequest) => void; onSuggestionsClearRequested?: () => void; getSuggestionValue: (suggestion: any) => any; renderSuggestion: (suggestion: any, inputValues: InputValues) => JSX.Element; inputProps: InputProps; - onSuggestionSelected?: (event: React.FormEvent, data: SuggestionSelectedEventData) => void; + onSuggestionSelected?: (event: React.FormEvent , data: SuggestionSelectedEventData ) => void; shouldRenderSuggestions?: (value: string) => boolean; alwaysRenderSuggestions?: boolean; focusFirstSuggestion?: boolean; @@ -71,4 +78,4 @@ import * as React from 'react'; id?: string; } - export class Autosuggest extends React.Component {} +} diff --git a/react-autosuggest/react-autosuggest-tests.tsx b/react-autosuggest/react-autosuggest-tests.tsx index 3eaee3e4e7..2dff0a82bd 100644 --- a/react-autosuggest/react-autosuggest-tests.tsx +++ b/react-autosuggest/react-autosuggest-tests.tsx @@ -1,42 +1,69 @@ // region Imports import React = require('react'); import ReactDOM = require('react-dom'); -import { Autosuggest, SuggestionSelectedEventData } from 'react-autosuggest'; +import * as Autosuggest from 'react-autosuggest'; // endregion interface Language { - name: string; - year: number; + name : string; + year : number; } -// https://developer.mozilla.org/en/docs/Web/JavaScript/Guide/Regular_Expressions#Using_Special_Characters -function escapeRegexCharacters(str: string): string { +// https://developer.mozilla.org/en/docs/Web/JavaScript/Guide/Regular_Expression +// s#Using_Special_Characters +function escapeRegexCharacters(str : string) : string { return str.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); } -export class ReactAutosuggestBasicTest extends React.Component { +export class ReactAutosuggestBasicTest extends React.Component { // region Fields - static languages: Language[] = [ - {name: 'C', year: 1972}, - {name: 'C#', year: 2000}, - {name: 'C++', year: 1983}, - {name: 'Clojure', year: 2007}, - {name: 'Elm', year: 2012}, - {name: 'Go', year: 2009}, - {name: 'Haskell', year: 1990}, - {name: 'Java', year: 1995}, - {name: 'Javascript', year: 1995}, - {name: 'Perl', year: 1987}, - {name: 'PHP', year: 1995}, - {name: 'Python', year: 1991}, - {name: 'Ruby', year: 1995}, - {name: 'Scala', year: 2003} + static languages : Language[] = [ + { + name: 'C', + year: 1972 + }, { + name: 'C#', + year: 2000 + }, { + name: 'C++', + year: 1983 + }, { + name: 'Clojure', + year: 2007 + }, { + name: 'Elm', + year: 2012 + }, { + name: 'Go', + year: 2009 + }, { + name: 'Haskell', + year: 1990 + }, { + name: 'Java', + year: 1995 + }, { + name: 'Javascript', + year: 1995 + }, { + name: 'Perl', + year: 1987 + }, { + name: 'PHP', + year: 1995 + }, { + name: 'Python', + year: 1991 + }, { + name: 'Ruby', + year: 1995 + }, { + name: 'Scala', + year: 2003 + } ]; - // endregion - - - // region Constructor - constructor(props: any) { + // endregion region Constructor + constructor(props : any) { super(props); this.state = { @@ -44,15 +71,15 @@ export class ReactAutosuggestBasicTest extends React.Component { suggestions: this.getSuggestions('') }; } - // endregion - - // region Rendering methods - render(): JSX.Element { + // endregion region Rendering methods + render() : JSX.Element { const {value, suggestions} = this.state; const inputProps = { placeholder: `Type 'c'`, value, - onChange: this.onChange.bind(this) + onChange: this + .onChange + .bind(this) }; const theme = { @@ -61,42 +88,38 @@ export class ReactAutosuggestBasicTest extends React.Component { suggestionFocused: 'active' }; - return ; + return ; } - protected onSuggestionsSelected(event: React.FormEvent, data: SuggestionSelectedEventData): void { + protected onSuggestionsSelected(event : React.FormEvent , data : Autosuggest.SuggestionSelectedEventData < Language >) : void { alert(`Selected language is ${data.suggestion.name} (${data.suggestion.year}).`); } - protected renderSuggestion(suggestion: Language): JSX.Element { + protected renderSuggestion(suggestion : Language) : JSX.Element { return {suggestion.name}; } - // endregion - - // region Event handlers - protected onChange(event: React.FormEvent, {newValue, method}: any): void { - this.setState({ - value: newValue - }); + // endregion region Event handlers + protected onChange(event : React.FormEvent , {newValue, method} : any) : void { + this.setState({value: newValue}); } - protected onSuggestionsFetchRequested({ value }: any): void { + protected onSuggestionsFetchRequested({value}: any) : void { this.setState({ suggestions: this.getSuggestions(value) }); } - // endregion - - // region Helper methods - protected getSuggestions(value: string): Language[] { + // endregion region Helper methods + protected getSuggestions(value: string) : Language[] { const escapedValue = escapeRegexCharacters(value.trim()); if (escapedValue === '') { @@ -105,69 +128,98 @@ export class ReactAutosuggestBasicTest extends React.Component { const regex = new RegExp('^' + escapedValue, 'i'); - return ReactAutosuggestBasicTest.languages.filter(language => regex.test(language.name)); + return ReactAutosuggestBasicTest + .languages + .filter(language => regex.test(language.name)); } - protected getSuggestionValue(suggestion: Language): string { - return suggestion.name; - } + protected getSuggestionValue(suggestion: Language) : string {return suggestion.name;} // endregion } -ReactDOM.render(, document.getElementById('app')); +ReactDOM.render( + , document.getElementById('app')); interface LanguageGroup { - title: string; - languages: Language[]; + title : string; + languages : Language[]; } -export class ReactAutosuggestMultipleTest extends React.Component { +export class ReactAutosuggestMultipleTest extends React.Component < any, +any > { // region Fields - static languages: LanguageGroup[] = [ + static languages : LanguageGroup[] = [ { title: '1970s', languages: [ - {name: 'C', year: 1972} + { + name: 'C', + year: 1972 + } ] - }, - { + }, { title: '1980s', languages: [ - {name: 'C++', year: 1983}, - {name: 'Perl', year: 1987} + { + name: 'C++', + year: 1983 + }, { + name: 'Perl', + year: 1987 + } ] - }, - { + }, { title: '1990s', languages: [ - {name: 'Haskell', year: 1990}, - {name: 'Python', year: 1991}, - {name: 'Java', year: 1995}, - {name: 'Javascript', year: 1995}, - {name: 'PHP', year: 1995}, - {name: 'Ruby', year: 1995} + { + name: 'Haskell', + year: 1990 + }, { + name: 'Python', + year: 1991 + }, { + name: 'Java', + year: 1995 + }, { + name: 'Javascript', + year: 1995 + }, { + name: 'PHP', + year: 1995 + }, { + name: 'Ruby', + year: 1995 + } ] - }, - { + }, { title: '2000s', languages: [ - {name: 'C#', year: 2000}, - {name: 'Scala', year: 2003}, - {name: 'Clojure', year: 2007}, - {name: 'Go', year: 2009} + { + name: 'C#', + year: 2000 + }, { + name: 'Scala', + year: 2003 + }, { + name: 'Clojure', + year: 2007 + }, { + name: 'Go', + year: 2009 + } ] - }, - { + }, { title: '2010s', languages: [ - {name: 'Elm', year: 2012} + { + name: 'Elm', + year: 2012 + } ] } ]; - // endregion - - // region Constructor - constructor(props: any) { + // endregion region Constructor + constructor(props : any) { super(props); this.state = { @@ -175,59 +227,56 @@ export class ReactAutosuggestMultipleTest extends React.Component { suggestions: this.getSuggestions('') }; } - // endregion - - // region Rendering methods - render(): JSX.Element { - const { value, suggestions } = this.state; + // endregion region Rendering methods + render() : JSX.Element { + const {value, suggestions} = this.state; const inputProps = { placeholder: `Type 'c'`, value, - onChange: this.onChange.bind(this) + onChange: this + .onChange + .bind(this) }; - return ; + return ; } - protected onSuggestionSelected(event: React.FormEvent, data: SuggestionSelectedEventData): void { + protected onSuggestionSelected(event : React.FormEvent , data : Autosuggest.SuggestionSelectedEventData < Language >) : void { const language = data.suggestion as Language; alert(`Selected language is ${language.name} (${language.year}).`); } - protected renderSuggestion(suggestion: Language): JSX.Element { + protected renderSuggestion(suggestion : Language) : JSX.Element { return {suggestion.name}; } - protected renderSectionTitle(section: LanguageGroup): JSX.Element { + protected renderSectionTitle(section : LanguageGroup) : JSX.Element { return {section.title}; } - // endregion - - // region Event handlers - protected onChange(event: React.FormEvent, { newValue, method }: any): void { - this.setState({ - value: newValue - }); + // endregion region Event handlers + protected onChange(event : React.FormEvent , {newValue, method} : any) : void { + this.setState({value: newValue}); } - protected onSuggestionsFetchRequested({ value }: any): void { + protected onSuggestionsFetchRequested({value} : any) : void { this.setState({ suggestions: this.getSuggestions(value) }); } - // endregion - - // region Helper methods - protected getSuggestions(value: string): LanguageGroup[] { + // endregion region Helper methods + protected getSuggestions(value : string) : LanguageGroup[] { const escapedValue = escapeRegexCharacters(value.trim()); if (escapedValue === '') { @@ -236,46 +285,62 @@ export class ReactAutosuggestMultipleTest extends React.Component { const regex = new RegExp('^' + escapedValue, 'i'); - return ReactAutosuggestMultipleTest.languages + return ReactAutosuggestMultipleTest + .languages .map(section => { return { title: section.title, - languages: section.languages.filter(language => regex.test(language.name)) + languages: section + .languages + .filter(language => regex.test(language.name)) }; }) .filter(section => section.languages.length > 0); } - protected getSuggestionValue(suggestion: Language) { + protected getSuggestionValue(suggestion : Language) { return suggestion.name; } - protected getSectionSuggestions(section: LanguageGroup) { + protected getSectionSuggestions(section : LanguageGroup) { return section.languages; } // endregion } -ReactDOM.render(, document.getElementById('app')); +ReactDOM.render( + , document.getElementById('app')); interface Person { - first: string; - last: string; - twitter: string; + first : string; + last : string; + twitter : string; } -export class ReactAutosuggestCustomTest extends React.Component { +export class ReactAutosuggestCustomTest extends React.Component < any, +any > { // region Fields - static people: Person[] = [ - {first: 'Charlie', last: 'Brown', twitter: 'dancounsell'}, - {first: 'Charlotte', last: 'White', twitter: 'mtnmissy'}, - {first: 'Chloe', last: 'Jones', twitter: 'ladylexy'}, - {first: 'Cooper', last: 'King', twitter: 'steveodom'} + static people : Person[] = [ + { + first: 'Charlie', + last: 'Brown', + twitter: 'dancounsell' + }, { + first: 'Charlotte', + last: 'White', + twitter: 'mtnmissy' + }, { + first: 'Chloe', + last: 'Jones', + twitter: 'ladylexy' + }, { + first: 'Cooper', + last: 'King', + twitter: 'steveodom' + } ]; - // endregion - - // region Constructor - constructor(props: any) { + // endregion region Constructor + constructor(props : any) { super(props); this.state = { @@ -283,64 +348,62 @@ export class ReactAutosuggestCustomTest extends React.Component { suggestions: this.getSuggestions('') }; } - // endregion - - // region Rendering methods - render(): JSX.Element { - const { value, suggestions } = this.state; + // endregion region Rendering methods + render() : JSX.Element { + const {value, suggestions} = this.state; const inputProps = { placeholder: "Type 'c'", value, - onChange: this.onChange.bind(this) + onChange: this + .onChange + .bind(this) }; - return ; + return ; } - protected renderSuggestion(suggestion: Person, { value, valueBeforeUpDown }: any): JSX.Element { + protected renderSuggestion(suggestion : Person, {value, valueBeforeUpDown} : any) : JSX.Element { const suggestionText = `${suggestion.first} ${suggestion.last}`; const query = (valueBeforeUpDown || value).trim(); - const parts = suggestionText.split(' ').map((part: string) => { - return { - highlight: (Math.ceil(Math.random() * 10)) % 2, - text: part - }; - }); + const parts = suggestionText + .split(' ') + .map((part : string) => { + return { + highlight: (Math.ceil(Math.random() * 10)) % 2, + text: part + }; + }); return - { - parts.map((part, index) => { - const className = part.highlight ? 'highlight' : undefined; + {parts.map((part, index) => { + const className = part.highlight + ? 'highlight' + : undefined; return {part.text}; - }) - } + }) +} ; } - // endregion - - // region Event handlers - protected onChange(event: React.FormEvent, {newValue, method}: any): void { - this.setState({ - value: newValue - }); + // endregion region Event handlers + protected onChange(event : React.FormEvent , {newValue, method} : any) : void { + this.setState({value: newValue}); } - protected onSuggestionsFetchRequested({ value }: any): void { + protected onSuggestionsFetchRequested({value} : any) : void { this.setState({ suggestions: this.getSuggestions(value) }); } - // endregion - - // region Helper methods - protected getSuggestions(value: string): Person[] { + // endregion region Helper methods + protected getSuggestions(value : string) : Person[] { const escapedValue = escapeRegexCharacters(value.trim()); if (escapedValue === '') { @@ -349,13 +412,14 @@ export class ReactAutosuggestCustomTest extends React.Component { const regex = new RegExp('\\b' + escapedValue, 'i'); - return ReactAutosuggestCustomTest.people.filter(person => regex.test(this.getSuggestionValue(person))); + return ReactAutosuggestCustomTest + .people + .filter(person => regex.test(this.getSuggestionValue(person))); } - protected getSuggestionValue(suggestion: Person): string { - return `${suggestion.first} ${suggestion.last}`; - } + protected getSuggestionValue(suggestion : Person) : string {return `${suggestion.first} ${suggestion.last}`;} // endregion } -ReactDOM.render(, document.getElementById('app')); +ReactDOM.render( + , document.getElementById('app')); From 931e518a1cb4ea7b19ca0245103eb8955e4719c7 Mon Sep 17 00:00:00 2001 From: Hugues Stefanski Date: Thu, 23 Feb 2017 21:31:36 +0100 Subject: [PATCH 64/81] Updated d3-geo to reflect measure method Update d3-geo version to 1.5.0 Updated d3 version to 4.6 --- d3-geo/d3-geo-tests.ts | 13 +++++++++++++ d3-geo/index.d.ts | 11 ++++++++++- d3/index.d.ts | 2 +- 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/d3-geo/d3-geo-tests.ts b/d3-geo/d3-geo-tests.ts index 3d28bb610f..f1701c10c8 100644 --- a/d3-geo/d3-geo-tests.ts +++ b/d3-geo/d3-geo-tests.ts @@ -537,6 +537,19 @@ geoPathCentroid = geoPathCanvas.centroid(sampleExtendedFeatureCollection); // geoPathCentroid = geoPathSVG.centroid(sampleExtendedFeatureCollection); // fails, wrong data object type + +// measure(...) ------------------------------------------------------ + +let geoPathMeasure: number = geoPathCanvas.measure(samplePolygon); +geoPathMeasure = geoPathCanvas.measure(sampleSphere); +geoPathMeasure = geoPathCanvas.measure(sampleGeometryCollection); +geoPathMeasure = geoPathCanvas.measure(sampleExtendedGeometryCollection); +geoPathMeasure = geoPathCanvas.measure(sampleFeature); +geoPathMeasure = geoPathCanvas.measure(sampleExtendedFeature1); +geoPathMeasure = geoPathCanvas.measure(sampleExtendedFeature2); +geoPathMeasure = geoPathCanvas.measure(sampleFeatureCollection); +geoPathMeasure = geoPathCanvas.measure(sampleExtendedFeatureCollection); + // render path to context of get path string---------------------------- // render to GeoContext/Canvas diff --git a/d3-geo/index.d.ts b/d3-geo/index.d.ts index 9ab3ae74cd..deeed4166e 100644 --- a/d3-geo/index.d.ts +++ b/d3-geo/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for D3JS d3-geo module v1.4.0 +// Type definitions for D3JS d3-geo module v1.5.0 // Project: https://github.com/d3/d3-geo/ // Definitions by: Hugues Stefanski , Tom Wanzek , Alex Ford , Boris Yankov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -935,6 +935,15 @@ export interface GeoPath { */ centroid(object: DatumObject): [number, number]; + /** + * Returns the projected planar length (typically in pixels) for the specified GeoJSON object. + * Point and MultiPoint features have zero length. For Polygon and MultiPolygon features, this method computes the summed length of all rings. + * This method observes any clipping performed by the projection. + * + * @param object GeoJSON object to measure. + */ + measure(object: DatumObject): number; + /** * Returns the current render context which defaults to null. * diff --git a/d3/index.d.ts b/d3/index.d.ts index bf7fa8e6b6..d5fe886d63 100644 --- a/d3/index.d.ts +++ b/d3/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for D3JS d3 standard bundle 4.5 +// Type definitions for D3JS d3 standard bundle 4.6 // Project: https://github.com/d3/d3 // Definitions by: Tom Wanzek , Alex Ford , Boris Yankov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped From 91de2cdf20e7d3c2a4414d07b6ff1066800b0355 Mon Sep 17 00:00:00 2001 From: Hugues Stefanski Date: Thu, 23 Feb 2017 21:41:06 +0100 Subject: [PATCH 65/81] Added blank line to make comment more readable --- d3-geo/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/d3-geo/index.d.ts b/d3-geo/index.d.ts index deeed4166e..ccaca7c1aa 100644 --- a/d3-geo/index.d.ts +++ b/d3-geo/index.d.ts @@ -938,6 +938,7 @@ export interface GeoPath { /** * Returns the projected planar length (typically in pixels) for the specified GeoJSON object. * Point and MultiPoint features have zero length. For Polygon and MultiPolygon features, this method computes the summed length of all rings. + * * This method observes any clipping performed by the projection. * * @param object GeoJSON object to measure. From 71d1224978e84eabf76de8aada2e34d8e070760f Mon Sep 17 00:00:00 2001 From: Terry Bayne Date: Mon, 27 Feb 2017 08:17:20 -0600 Subject: [PATCH 66/81] Updated version supported to react-autosuggest 8.0 --- react-autosuggest/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/react-autosuggest/index.d.ts b/react-autosuggest/index.d.ts index d028e0b595..5f3648eb3a 100644 --- a/react-autosuggest/index.d.ts +++ b/react-autosuggest/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for react-autosuggest 7.0 +// Type definitions for react-autosuggest 8.0 // Project: http://react-autosuggest.js.org/ // Definitions by: Nicolas Schmitt , Philip Ottesen , Robert Essig , Terry Bayne // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped From 6fd0e9e82dd55e17bd44e9f5e147e4b3baa48a65 Mon Sep 17 00:00:00 2001 From: Terry Bayne Date: Mon, 27 Feb 2017 08:42:06 -0600 Subject: [PATCH 67/81] Removed unnecessary export as statement --- react-autosuggest/index.d.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/react-autosuggest/index.d.ts b/react-autosuggest/index.d.ts index 5f3648eb3a..13f88eb00b 100644 --- a/react-autosuggest/index.d.ts +++ b/react-autosuggest/index.d.ts @@ -10,7 +10,6 @@ import * as React from 'react'; declare class Autosuggest extends React.Component {} export = Autosuggest; -export as namespace Autosuggest; declare namespace Autosuggest { interface SuggestionsFetchRequest { From dbf6e9353d318dc8c23d0ba07e53635fb9e50343 Mon Sep 17 00:00:00 2001 From: Terry Bayne Date: Mon, 27 Feb 2017 09:48:51 -0600 Subject: [PATCH 68/81] Changes for DefinatelyTyped: Removed tslint:disable:dt-header comment Changed import to use require in tests Formatting fixed around type parameters --- react-autosuggest/index.d.ts | 15 ++++---- react-autosuggest/react-autosuggest-tests.tsx | 38 +++++++++---------- 2 files changed, 25 insertions(+), 28 deletions(-) diff --git a/react-autosuggest/index.d.ts b/react-autosuggest/index.d.ts index 13f88eb00b..7199fefcdb 100644 --- a/react-autosuggest/index.d.ts +++ b/react-autosuggest/index.d.ts @@ -4,10 +4,9 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.1 -/* tslint:disable:dt-header */ import * as React from 'react'; -declare class Autosuggest extends React.Component {} +declare class Autosuggest extends React.Component {} export = Autosuggest; @@ -31,13 +30,13 @@ declare namespace Autosuggest { focusedSuggestion: any; } - interface InputProps extends React.HTMLAttributes { + interface InputProps extends React.HTMLAttributes { value: string; - onChange: (event: React.FormEvent , params?: ChangeEvent) => void; - onBlur?: (event: React.FormEvent , params?: BlurEvent) => void; + onChange: (event: React.FormEvent, params?: ChangeEvent) => void; + onBlur?: (event: React.FormEvent, params?: BlurEvent) => void; } - export interface SuggestionSelectedEventData { + export interface SuggestionSelectedEventData { method: 'click' | 'enter'; sectionIndex: number | null; suggestion: TSuggestion; @@ -56,14 +55,14 @@ declare namespace Autosuggest { suggestionsContainer?: string; } - interface AutosuggestProps extends React.Props < Autosuggest > { + interface AutosuggestProps extends React.Props { suggestions: any[]; onSuggestionsFetchRequested: (request: SuggestionsFetchRequest) => void; onSuggestionsClearRequested?: () => void; getSuggestionValue: (suggestion: any) => any; renderSuggestion: (suggestion: any, inputValues: InputValues) => JSX.Element; inputProps: InputProps; - onSuggestionSelected?: (event: React.FormEvent , data: SuggestionSelectedEventData ) => void; + onSuggestionSelected?: (event: React.FormEvent, data: SuggestionSelectedEventData) => void; shouldRenderSuggestions?: (value: string) => boolean; alwaysRenderSuggestions?: boolean; focusFirstSuggestion?: boolean; diff --git a/react-autosuggest/react-autosuggest-tests.tsx b/react-autosuggest/react-autosuggest-tests.tsx index 2dff0a82bd..f5ecaedc63 100644 --- a/react-autosuggest/react-autosuggest-tests.tsx +++ b/react-autosuggest/react-autosuggest-tests.tsx @@ -1,7 +1,7 @@ // region Imports import React = require('react'); import ReactDOM = require('react-dom'); -import * as Autosuggest from 'react-autosuggest'; +import Autosuggest = require('react-autosuggest'); // endregion interface Language { @@ -15,7 +15,7 @@ function escapeRegexCharacters(str : string) : string { return str.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); } -export class ReactAutosuggestBasicTest extends React.Component { +export class ReactAutosuggestBasicTest extends React.Component { // region Fields static languages : Language[] = [ { @@ -101,7 +101,7 @@ export class ReactAutosuggestBasicTest extends React.Component { theme={theme}/>; } - protected onSuggestionsSelected(event : React.FormEvent , data : Autosuggest.SuggestionSelectedEventData < Language >) : void { + protected onSuggestionsSelected(event : React.FormEvent, data : Autosuggest.SuggestionSelectedEventData) : void { alert(`Selected language is ${data.suggestion.name} (${data.suggestion.year}).`); } @@ -109,7 +109,7 @@ export class ReactAutosuggestBasicTest extends React.Component { return {suggestion.name}; } // endregion region Event handlers - protected onChange(event : React.FormEvent , {newValue, method} : any) : void { + protected onChange(event : React.FormEvent, {newValue, method} : any) : void { this.setState({value: newValue}); } @@ -138,15 +138,14 @@ export class ReactAutosuggestBasicTest extends React.Component { } ReactDOM.render( - , document.getElementById('app')); + , document.getElementById('app')); interface LanguageGroup { title : string; languages : Language[]; } -export class ReactAutosuggestMultipleTest extends React.Component < any, -any > { +export class ReactAutosuggestMultipleTest extends React.Component { // region Fields static languages : LanguageGroup[] = [ { @@ -252,7 +251,7 @@ any > { inputProps={inputProps}/>; } - protected onSuggestionSelected(event : React.FormEvent , data : Autosuggest.SuggestionSelectedEventData < Language >) : void { + protected onSuggestionSelected(event : React.FormEvent, data : Autosuggest.SuggestionSelectedEventData) : void { const language = data.suggestion as Language; alert(`Selected language is ${language.name} (${language.year}).`); @@ -266,7 +265,7 @@ any > { return {section.title}; } // endregion region Event handlers - protected onChange(event : React.FormEvent , {newValue, method} : any) : void { + protected onChange(event : React.FormEvent, {newValue, method} : any) : void { this.setState({value: newValue}); } @@ -309,7 +308,7 @@ any > { } ReactDOM.render( - , document.getElementById('app')); + , document.getElementById('app')); interface Person { first : string; @@ -317,8 +316,7 @@ interface Person { twitter : string; } -export class ReactAutosuggestCustomTest extends React.Component < any, -any > { +export class ReactAutosuggestCustomTest extends React.Component { // region Fields static people : Person[] = [ { @@ -359,7 +357,7 @@ any > { .bind(this) }; - return { }; }); - return - + return + {parts.map((part, index) => { const className = part.highlight ? 'highlight' : undefined; - return {part.text}; + return{part.text}; }) } - - ; + + ; } // endregion region Event handlers - protected onChange(event : React.FormEvent , {newValue, method} : any) : void { + protected onChange(event : React.FormEvent, {newValue, method} : any) : void { this.setState({value: newValue}); } @@ -422,4 +420,4 @@ any > { } ReactDOM.render( - , document.getElementById('app')); + , document.getElementById('app')); From c448633181deae962767c07b2b6d30c4aec1d3a1 Mon Sep 17 00:00:00 2001 From: Philip Tom Date: Mon, 13 Feb 2017 15:21:34 -0600 Subject: [PATCH 69/81] [selenium-webdriver] adding typings for remote file detector Needed to mark indexd.d.ts with TypeScript Version 2.1 since the existing test requires TS 2.1. Also, needed to mark protractor-helpers with TS 2.1 since it's Jasmine dependency requries TS 2.1. --- protractor-helpers/index.d.ts | 1 + selenium-webdriver/index.d.ts | 1 + selenium-webdriver/remote.d.ts | 38 +++++++++++++++++++++++++++++++ selenium-webdriver/test/remote.ts | 11 +++++++++ selenium-webdriver/tsconfig.json | 3 ++- 5 files changed, 53 insertions(+), 1 deletion(-) create mode 100644 selenium-webdriver/test/remote.ts diff --git a/protractor-helpers/index.d.ts b/protractor-helpers/index.d.ts index 3ab4691778..9821f5ba0c 100644 --- a/protractor-helpers/index.d.ts +++ b/protractor-helpers/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/wix/protractor-helpers // Definitions by: John Cant // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 /// diff --git a/selenium-webdriver/index.d.ts b/selenium-webdriver/index.d.ts index 39d56d7d5b..25b9b96017 100644 --- a/selenium-webdriver/index.d.ts +++ b/selenium-webdriver/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/SeleniumHQ/selenium/tree/master/javascript/node/selenium-webdriver // Definitions by: Bill Armstrong , Yuki Kokubun , Craig Nishina // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import * as chrome from './chrome'; import * as edge from './edge'; diff --git a/selenium-webdriver/remote.d.ts b/selenium-webdriver/remote.d.ts index ae4f156ba7..384ca521ac 100644 --- a/selenium-webdriver/remote.d.ts +++ b/selenium-webdriver/remote.d.ts @@ -65,3 +65,41 @@ export class DriverService { */ stop(): webdriver.promise.Promise; } + +/** + * A {@link webdriver.FileDetector} that may be used when running + * against a remote + * [Selenium server](http://selenium-release.storage.googleapis.com/index.html). + * + * When a file path on the local machine running this script is entered with + * {@link webdriver.WebElement#sendKeys WebElement#sendKeys}, this file detector + * will transfer the specified file to the Selenium server's host; the sendKeys + * command will be updated to use the transfered file's path. + * + * __Note:__ This class depends on a non-standard command supported on the + * Java Selenium server. The file detector will fail if used with a server that + * only supports standard WebDriver commands (such as the ChromeDriver). + * + * @final + */ +export class FileDetector extends webdriver.FileDetector { + /** + * @constructor + **/ + constructor(); + + /** + * Prepares a `file` for use with the remote browser. If the provided path + * does not reference a normal file (i.e. it does not exist or is a + * directory), then the promise returned by this method will be resolved with + * the original file path. Otherwise, this method will upload the file to the + * remote server, which will return the file's path on the remote system so + * it may be referenced in subsequent commands. + * + * @param {!webdriver.WebDriver} driver The driver for the current browser. + * @param {string} file The path of the file to process. + * @return {!webdriver.promise.Promise} A promise for the processed + * file path. + */ + handleFile(driver: webdriver.WebDriver, file: string): webdriver.promise.Promise; +} diff --git a/selenium-webdriver/test/remote.ts b/selenium-webdriver/test/remote.ts new file mode 100644 index 0000000000..a783101290 --- /dev/null +++ b/selenium-webdriver/test/remote.ts @@ -0,0 +1,11 @@ +import * as remote from "selenium-webdriver/remote"; +import * as webdriver from "selenium-webdriver"; + +function TestRemoteFileDetector() { + const driver: webdriver.WebDriver = new webdriver.Builder() + .withCapabilities(webdriver.Capabilities.chrome()) + .build(); + + const fileDetector: remote.FileDetector = new remote.FileDetector(); + fileDetector.handleFile(driver, 'path/to/file').then((path: string) => { /* empty */ }); +} diff --git a/selenium-webdriver/tsconfig.json b/selenium-webdriver/tsconfig.json index 50c76c7b28..6d56d236be 100644 --- a/selenium-webdriver/tsconfig.json +++ b/selenium-webdriver/tsconfig.json @@ -30,6 +30,7 @@ "testing.d.ts", "test/index.ts", "test/chrome.ts", - "test/firefox.ts" + "test/firefox.ts", + "test/remote.ts" ] } \ No newline at end of file From 7ad5ff8bbbbfad9f5d074d1fcc5c711b881d30bd Mon Sep 17 00:00:00 2001 From: Chad Auld Date: Fri, 3 Mar 2017 10:00:42 -0700 Subject: [PATCH 70/81] Adding hoveredStyle to the material-ui IconButton property list --- material-ui/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/material-ui/index.d.ts b/material-ui/index.d.ts index c399116482..90e19b43e9 100644 --- a/material-ui/index.d.ts +++ b/material-ui/index.d.ts @@ -723,6 +723,7 @@ declare namespace __MaterialUI { className?: string; disableTouchRipple?: boolean; disabled?: boolean; + hoveredStyle?: React.CSSProperties; iconClassName?: string; iconStyle?: React.CSSProperties; onBlur?: React.FocusEventHandler<{}>; From 5d4a849576a18a48d7ef008bbaa0f1cde49cf04f Mon Sep 17 00:00:00 2001 From: Hugues Stefanski Date: Sun, 5 Mar 2017 10:21:38 +0100 Subject: [PATCH 71/81] Doc style changes for consistency --- d3-geo/index.d.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/d3-geo/index.d.ts b/d3-geo/index.d.ts index ccaca7c1aa..02ce38ba93 100644 --- a/d3-geo/index.d.ts +++ b/d3-geo/index.d.ts @@ -908,7 +908,7 @@ export interface GeoPath { * this method first computes the area of the exterior ring, and then subtracts the area of any interior holes. * This method observes any clipping performed by the projection; see projection.clipAngle and projection.clipExtent. * - * @param An object for which the area is to be calculated. + * @param object An object for which the area is to be calculated. */ area(object: DatumObject): number; @@ -921,7 +921,7 @@ export interface GeoPath { * the minimum latitude is typically the maximum y-value, and the maximum latitude is typically the minimum y-value.) * This method observes any clipping performed by the projection; see projection.clipAngle and projection.clipExtent. * - * @param An object for which the bounds are to be calculated. + * @param object An object for which the bounds are to be calculated. */ bounds(object: DatumObject): [[number, number], [number, number]]; @@ -931,7 +931,7 @@ export interface GeoPath { * For example, a noncontiguous cartogram might scale each state around its centroid. * This method observes any clipping performed by the projection; see projection.clipAngle and projection.clipExtent. * - * @param An object for which the centroid is to be calculated. + * @param pbject An object for which the centroid is to be calculated. */ centroid(object: DatumObject): [number, number]; @@ -941,7 +941,7 @@ export interface GeoPath { * * This method observes any clipping performed by the projection. * - * @param object GeoJSON object to measure. + * @param object An object for which the measure is to be calculated. */ measure(object: DatumObject): number; From 6de6f869adbcde12728196f273a448c49492fec1 Mon Sep 17 00:00:00 2001 From: Marc Woolfson Date: Mon, 6 Mar 2017 15:55:03 +0000 Subject: [PATCH 72/81] Allowed dc.legend().property() calls to be chained --- dc/dc-tests.ts | 2 ++ dc/index.d.ts | 16 ++++++++-------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/dc/dc-tests.ts b/dc/dc-tests.ts index 9d2688fdf0..643594276d 100644 --- a/dc/dc-tests.ts +++ b/dc/dc-tests.ts @@ -180,6 +180,8 @@ d3.json("data/yelp_test_set_business.json", (yelp_data:IYelpData[]) => { .xAxis() .tickFormat((v: string) => v); + lineChart.legend(dc.legend().x(200).y(10).itemHeight(13).gap(5)); + rowChart .width(340) .height(850) diff --git a/dc/index.d.ts b/dc/index.d.ts index e7be4f86aa..9f9d7d3a57 100644 --- a/dc/index.d.ts +++ b/dc/index.d.ts @@ -111,14 +111,14 @@ declare namespace dc { } export interface Legend { - x: IGetSet; - y: IGetSet; - gap: IGetSet; - itemHeight: IGetSet; - horizontal: IGetSet; - legendWidth: IGetSet; - itemWidth: IGetSet; - autoItemWidth: IGetSet; + x: IGetSet; + y: IGetSet; + gap: IGetSet; + itemHeight: IGetSet; + horizontal: IGetSet; + legendWidth: IGetSet; + itemWidth: IGetSet; + autoItemWidth: IGetSet; render: () => void; } From 796b98ffef8e9b13b7a40aaee2ab4c6ea04cc7e4 Mon Sep 17 00:00:00 2001 From: Chad Killingsworth Date: Mon, 6 Mar 2017 15:28:27 -0600 Subject: [PATCH 73/81] Add definitions for acorn tokenizer function --- acorn/acorn-tests.ts | 3 +++ acorn/index.d.ts | 9 ++++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/acorn/acorn-tests.ts b/acorn/acorn-tests.ts index fb79d23718..bda6844c84 100644 --- a/acorn/acorn-tests.ts +++ b/acorn/acorn-tests.ts @@ -67,3 +67,6 @@ acorn.getLineInfo('string', 56); acorn.plugins['test'] = function (p: acorn.Parser, config: any) { } + +acorn.tokenizer('console.log("hello world)', {locations: true}).getToken(); +acorn.tokenizer('console.log("hello world)', {locations: true})[Symbol.iterator]().next(); diff --git a/acorn/index.d.ts b/acorn/index.d.ts index 1944abc257..441deb29c3 100644 --- a/acorn/index.d.ts +++ b/acorn/index.d.ts @@ -238,9 +238,12 @@ declare namespace acorn { function parseExpressionAt(input: string, pos?: number, options?: Options): ESTree.Expression; - // todo: here the tokenizer function returns a Parser instance, that is targeting the detail of - // Parser prototype. Someone need this please reade README.md first. - // function tokenizer(options: Options, input: string): Parser; + interface ITokenizer { + getToken() : Token, + [Symbol.iterator](): Iterator + } + + function tokenizer(input: string, options: Options): ITokenizer; let parse_dammit: IParse | undefined; let LooseParser: ILooseParserClass | undefined; From 023117be187ae595c015dc6be82f580dd5d9754e Mon Sep 17 00:00:00 2001 From: Jay Anslow Date: Tue, 7 Mar 2017 10:49:59 +0000 Subject: [PATCH 74/81] deep-equal accepts all types as arguments. Previously only accepted defined objects. Also enable strictNullChecks. --- deep-equal/deep-equal-tests.ts | 7 +++++-- deep-equal/index.d.ts | 6 +++--- deep-equal/tsconfig.json | 2 +- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/deep-equal/deep-equal-tests.ts b/deep-equal/deep-equal-tests.ts index 2f4f238a4f..327067b29d 100644 --- a/deep-equal/deep-equal-tests.ts +++ b/deep-equal/deep-equal-tests.ts @@ -1,8 +1,11 @@ -import * as deepEqual from "deep-equal"; +import deepEqual = require("deep-equal"); let isDeepEqual1: boolean = deepEqual({}, {}); let isDeepEqual2: boolean = deepEqual({}, {}, { strict: true }); let isDeepEqual3: boolean = deepEqual({}, {}, { strict: false }); +let isDeepEqual4: boolean = deepEqual(undefined, undefined); +let isDeepEqual5: boolean = deepEqual(3, false); +let isDeepEqual6: boolean = deepEqual("a-string", null); -console.log(isDeepEqual1, isDeepEqual2, isDeepEqual3); +console.log(isDeepEqual1, isDeepEqual2, isDeepEqual3, isDeepEqual4, isDeepEqual5, isDeepEqual6); diff --git a/deep-equal/index.d.ts b/deep-equal/index.d.ts index eef762a4ea..20a0f30275 100644 --- a/deep-equal/index.d.ts +++ b/deep-equal/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for deep-equal // Project: https://github.com/substack/node-deep-equal -// Definitions by: remojansen +// Definitions by: remojansen , Jay Anslow // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -10,8 +10,8 @@ interface DeepEqualOptions { } declare let deepEqual: ( - actual: Object, - expected: Object, + actual: any, + expected: any, opts?: DeepEqualOptions) => boolean; export = deepEqual; diff --git a/deep-equal/tsconfig.json b/deep-equal/tsconfig.json index b192443e3f..6d21a4a7e6 100644 --- a/deep-equal/tsconfig.json +++ b/deep-equal/tsconfig.json @@ -7,7 +7,7 @@ ], "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": false, + "strictNullChecks": true, "baseUrl": "../", "typeRoots": [ "../" From f102b10f38a9dc9fd96fd56a982a5ceb87fbbaf7 Mon Sep 17 00:00:00 2001 From: Jay Anslow Date: Tue, 7 Mar 2017 11:11:45 +0000 Subject: [PATCH 75/81] Enable linting and fix errors --- deep-equal/deep-equal-tests.ts | 12 ++++++------ deep-equal/index.d.ts | 8 +++----- deep-equal/tslint.json | 3 +++ 3 files changed, 12 insertions(+), 11 deletions(-) create mode 100644 deep-equal/tslint.json diff --git a/deep-equal/deep-equal-tests.ts b/deep-equal/deep-equal-tests.ts index 327067b29d..ed23a35838 100644 --- a/deep-equal/deep-equal-tests.ts +++ b/deep-equal/deep-equal-tests.ts @@ -1,11 +1,11 @@ import deepEqual = require("deep-equal"); -let isDeepEqual1: boolean = deepEqual({}, {}); -let isDeepEqual2: boolean = deepEqual({}, {}, { strict: true }); -let isDeepEqual3: boolean = deepEqual({}, {}, { strict: false }); -let isDeepEqual4: boolean = deepEqual(undefined, undefined); -let isDeepEqual5: boolean = deepEqual(3, false); -let isDeepEqual6: boolean = deepEqual("a-string", null); +const isDeepEqual1: boolean = deepEqual({}, {}); +const isDeepEqual2: boolean = deepEqual({}, {}, { strict: true }); +const isDeepEqual3: boolean = deepEqual({}, {}, { strict: false }); +const isDeepEqual4: boolean = deepEqual(undefined, undefined); +const isDeepEqual5: boolean = deepEqual(3, false); +const isDeepEqual6: boolean = deepEqual("a-string", null); console.log(isDeepEqual1, isDeepEqual2, isDeepEqual3, isDeepEqual4, isDeepEqual5, isDeepEqual6); diff --git a/deep-equal/index.d.ts b/deep-equal/index.d.ts index 20a0f30275..d9c4b5f6cf 100644 --- a/deep-equal/index.d.ts +++ b/deep-equal/index.d.ts @@ -1,17 +1,15 @@ -// Type definitions for deep-equal +// Type definitions for deep-equal 1.0 // Project: https://github.com/substack/node-deep-equal // Definitions by: remojansen , Jay Anslow // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - - interface DeepEqualOptions { strict: boolean; } -declare let deepEqual: ( +declare function deepEqual( actual: any, expected: any, - opts?: DeepEqualOptions) => boolean; + opts?: DeepEqualOptions): boolean; export = deepEqual; diff --git a/deep-equal/tslint.json b/deep-equal/tslint.json new file mode 100644 index 0000000000..f9e30021f4 --- /dev/null +++ b/deep-equal/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "../tslint.json" +} From b83cfcea0771383a1bdcfd15efe429042ee5835e Mon Sep 17 00:00:00 2001 From: Keith Dahlby Date: Tue, 7 Mar 2017 00:55:53 -0600 Subject: [PATCH 76/81] Rearrange for DefinitelyTyped --- griddle-react/.babelrc | 3 -- griddle-react/.gitignore | 40 ------------------ griddle-react/.travis.yml | 5 --- griddle-react/LICENSE | 21 ---------- griddle-react/README.md | 14 ------- .../test.tsx => griddle-react-tests.tsx} | 17 +++++++- .../{griddle-react.d.ts => index.d.ts} | 32 +++++++++++++- griddle-react/package.json | 42 ------------------- griddle-react/test/CustomColumnComponent.tsx | 6 +++ griddle-react/test/CustomFilterComponent.tsx | 6 +++ griddle-react/test/CustomHeaderComponent.tsx | 6 +++ griddle-react/test/index.html | 9 ---- griddle-react/test/index.tsx | 17 -------- griddle-react/tsconfig.json | 31 ++++++++++---- griddle-react/tslint.json | 3 ++ griddle-react/typings.json | 4 -- griddle-react/webpack.config.js | 20 --------- 17 files changed, 90 insertions(+), 186 deletions(-) delete mode 100644 griddle-react/.babelrc delete mode 100644 griddle-react/.gitignore delete mode 100644 griddle-react/.travis.yml delete mode 100644 griddle-react/LICENSE delete mode 100644 griddle-react/README.md rename griddle-react/{test/test.tsx => griddle-react-tests.tsx} (74%) rename griddle-react/{griddle-react.d.ts => index.d.ts} (75%) delete mode 100644 griddle-react/package.json delete mode 100644 griddle-react/test/index.html delete mode 100644 griddle-react/test/index.tsx create mode 100644 griddle-react/tslint.json delete mode 100644 griddle-react/typings.json delete mode 100644 griddle-react/webpack.config.js diff --git a/griddle-react/.babelrc b/griddle-react/.babelrc deleted file mode 100644 index facd180928..0000000000 --- a/griddle-react/.babelrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "presets": ["es2015", "react"] -} \ No newline at end of file diff --git a/griddle-react/.gitignore b/griddle-react/.gitignore deleted file mode 100644 index 0a7b2a3260..0000000000 --- a/griddle-react/.gitignore +++ /dev/null @@ -1,40 +0,0 @@ -*.iml -.idea -/target -/typings - -output/ - -# Logs -logs -*.log -npm-debug.log* - -# Runtime data -pids -*.pid -*.seed - -# Directory for instrumented libs generated by jscoverage/JSCover -lib-cov - -# Coverage directory used by tools like istanbul -coverage - -# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) -.grunt - -# node-waf configuration -.lock-wscript - -# Compiled binary addons (http://nodejs.org/api/addons.html) -build/Release - -# Dependency directory -node_modules - -# Optional npm cache directory -.npm - -# Optional REPL history -.node_repl_history diff --git a/griddle-react/.travis.yml b/griddle-react/.travis.yml deleted file mode 100644 index c5c95c6331..0000000000 --- a/griddle-react/.travis.yml +++ /dev/null @@ -1,5 +0,0 @@ -language: node_js -node_js: - - "5.8" - - "5.7" - - "4.4" \ No newline at end of file diff --git a/griddle-react/LICENSE b/griddle-react/LICENSE deleted file mode 100644 index 0794d0b4a6..0000000000 --- a/griddle-react/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2016 David Hara - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/griddle-react/README.md b/griddle-react/README.md deleted file mode 100644 index 25169cfd6d..0000000000 --- a/griddle-react/README.md +++ /dev/null @@ -1,14 +0,0 @@ -# griddle-react-typings -[![Build Status](https://travis-ci.org/hodavidhara/griddle-react-typings.svg?branch=master)](https://travis-ci.org/hodavidhara/griddle-react-typings) - -Typescript 2.1 definition for https://griddlegriddle.github.io/Griddle/ - -## Testing -run: -``` -npm install -npm test -npm start -``` - -then open your browser to http://localhost:8080/webpack-dev-server/test/ diff --git a/griddle-react/test/test.tsx b/griddle-react/griddle-react-tests.tsx similarity index 74% rename from griddle-react/test/test.tsx rename to griddle-react/griddle-react-tests.tsx index 9888658f8d..5f241feeb5 100644 --- a/griddle-react/test/test.tsx +++ b/griddle-react/griddle-react-tests.tsx @@ -1,6 +1,15 @@ +/* +Licensed under the MIT License (MIT) + +Copyright (c) 2016 David Hara +*/ + import * as React from 'react'; import { render } from 'react-dom'; import Griddle, { CustomColumnComponentProps } from 'griddle-react'; +import CustomColumnComponentGrid from './test/CustomColumnComponent'; +import CustomHeaderComponentGrid from './test/CustomHeaderComponent'; +import CustomFilterComponentGrid from './test/CustomFilterComponent'; interface MyCustomResult { name: string, @@ -50,6 +59,12 @@ const TypedGriddle = Griddle as TypedGriddle; render(
+

Custom Column Component Grid

+ +

Custom Header Component Grid

+ +

Custom Filter Component Grid

+
, document.getElementById('root') -); \ No newline at end of file +); diff --git a/griddle-react/griddle-react.d.ts b/griddle-react/index.d.ts similarity index 75% rename from griddle-react/griddle-react.d.ts rename to griddle-react/index.d.ts index 90a09c1e36..e5d3e560bb 100644 --- a/griddle-react/griddle-react.d.ts +++ b/griddle-react/index.d.ts @@ -1,3 +1,33 @@ +// Type definitions for griddle-react 0.7 +// Project: https://github.com/griddlegriddle/griddle +// Definitions by: David Hara +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 + +/* +The MIT License (MIT) + +Copyright (c) 2016 David Hara + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + import * as React from 'react'; type ReactClass = React.ComponentClass | React.StatelessComponent @@ -137,4 +167,4 @@ export interface GriddleProps { declare class Griddle extends React.Component, any> { } -export default Griddle; \ No newline at end of file +export default Griddle; diff --git a/griddle-react/package.json b/griddle-react/package.json deleted file mode 100644 index 167b423124..0000000000 --- a/griddle-react/package.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "name": "griddle-react-typings", - "version": "0.7.1", - "description": "", - "repository": { - "type": "git", - "url": "https://github.com/hodavidhara/griddle-react-typings.git" - }, - "main": "griddle-react.d.ts", - "scripts": { - "test": "tsc", - "start": "webpack-dev-server" - }, - "author": "", - "license": "MIT", - "peerDependencies": { - "@types/react": "^0.14.3 || ^15.0.1", - "@types/react-dom": "^0.14.3 || ^15.0.1", - "react": "^0.14.3 || ^15.0.1", - "react-dom": "^0.14.3 || ^15.0.1" - }, - "dependencies": { - "@types/lodash": "^4.12.0", - "griddle-react": "^0.7.1", - "lodash": "^4.12.0" - }, - "devDependencies": { - "@types/react": "^0.14.3 || ^15.0.1", - "@types/react-dom": "^0.14.3 || ^15.0.1", - "babel-core": "^6.7.4", - "babel-loader": "^6.2.4", - "babel-preset-es2015": "^6.6.0", - "babel-preset-react": "^6.5.0", - "react": "^0.14.3 || ^15.0.1", - "react-dom": "^0.14.3 || ^15.0.1", - "ts-loader": "^0.8.1", - "typescript": "^2.1.0", - "typings": "^0.7.9", - "webpack": "^1.12.14", - "webpack-dev-server": "^1.14.1" - } -} diff --git a/griddle-react/test/CustomColumnComponent.tsx b/griddle-react/test/CustomColumnComponent.tsx index 3f9b9cd22b..83adc8f05a 100644 --- a/griddle-react/test/CustomColumnComponent.tsx +++ b/griddle-react/test/CustomColumnComponent.tsx @@ -1,3 +1,9 @@ +/* +Licensed under the MIT License (MIT) + +Copyright (c) 2016 David Hara +*/ + import * as React from 'react'; import Griddle, { CustomColumnComponentProps } from 'griddle-react'; diff --git a/griddle-react/test/CustomFilterComponent.tsx b/griddle-react/test/CustomFilterComponent.tsx index 349b132947..cb06f11703 100644 --- a/griddle-react/test/CustomFilterComponent.tsx +++ b/griddle-react/test/CustomFilterComponent.tsx @@ -1,3 +1,9 @@ +/* +Licensed under the MIT License (MIT) + +Copyright (c) 2016 David Hara +*/ + import * as _ from 'lodash'; import * as React from 'react'; import Griddle, { CustomFilterComponentProps } from 'griddle-react'; diff --git a/griddle-react/test/CustomHeaderComponent.tsx b/griddle-react/test/CustomHeaderComponent.tsx index 0d59405c5a..359cfc74a8 100644 --- a/griddle-react/test/CustomHeaderComponent.tsx +++ b/griddle-react/test/CustomHeaderComponent.tsx @@ -1,3 +1,9 @@ +/* +Licensed under the MIT License (MIT) + +Copyright (c) 2016 David Hara +*/ + import * as React from 'react'; import Griddle, { ColumnMetaData, CustomHeaderComponentProps } from 'griddle-react'; diff --git a/griddle-react/test/index.html b/griddle-react/test/index.html deleted file mode 100644 index 2ce79ad3c7..0000000000 --- a/griddle-react/test/index.html +++ /dev/null @@ -1,9 +0,0 @@ - - - - - -
- - - \ No newline at end of file diff --git a/griddle-react/test/index.tsx b/griddle-react/test/index.tsx deleted file mode 100644 index 8883029708..0000000000 --- a/griddle-react/test/index.tsx +++ /dev/null @@ -1,17 +0,0 @@ -import * as React from 'react'; -import { render } from 'react-dom'; -import CustomColumnComponentGrid from './CustomColumnComponent'; -import CustomHeaderComponentGrid from './CustomHeaderComponent'; -import CustomFilterComponentGrid from './CustomFilterComponent'; - -render( -
-

Custom Column Component Grid

- -

Custom Header Component Grid

- -

Custom Filter Component Grid

- -
, - document.getElementById('root') -); \ No newline at end of file diff --git a/griddle-react/tsconfig.json b/griddle-react/tsconfig.json index 7f01a8e329..2482b52409 100644 --- a/griddle-react/tsconfig.json +++ b/griddle-react/tsconfig.json @@ -1,14 +1,27 @@ { "compilerOptions": { - "module": "es2015", - "outDir": "./target", + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], "jsx": "preserve", - "target": "es6" + "noImplicitAny": false, + "noImplicitThis": true, + "strictNullChecks": false, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true }, - "exclude": [ - "node_modules", - "griddle-react.d.ts", - "typings/main", - "typings/main.d.ts" + "files": [ + "index.d.ts", + "griddle-react-tests.tsx", + "test/CustomColumnComponent.tsx", + "test/CustomFilterComponent.tsx", + "test/CustomHeaderComponent.tsx" ] -} \ No newline at end of file +} diff --git a/griddle-react/tslint.json b/griddle-react/tslint.json new file mode 100644 index 0000000000..f9e30021f4 --- /dev/null +++ b/griddle-react/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "../tslint.json" +} diff --git a/griddle-react/typings.json b/griddle-react/typings.json deleted file mode 100644 index b7346e0ead..0000000000 --- a/griddle-react/typings.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "griddle-react", - "main": "griddle-react.d.ts" -} diff --git a/griddle-react/webpack.config.js b/griddle-react/webpack.config.js deleted file mode 100644 index 03320a27b5..0000000000 --- a/griddle-react/webpack.config.js +++ /dev/null @@ -1,20 +0,0 @@ -module.exports = { - entry: ['./test/index.tsx'], - resolve: { - extensions: ["", ".webpack.js", ".web.js", ".js", ".ts", ".tsx"] - }, - output: { - path: './output/', - filename: 'bundle.js' - }, - module: { - loaders: [ - { - test: /.tsx?$/, - loaders: ['babel-loader', 'ts-loader'], - exclude: /node_modules/ - } - ] - }, - devtool: "#source-map" -}; \ No newline at end of file From b079a600785b52e52a4e879325a4460ebd57afa6 Mon Sep 17 00:00:00 2001 From: Keith Dahlby Date: Tue, 7 Mar 2017 01:11:37 -0600 Subject: [PATCH 77/81] Enable noImplicitAny --- griddle-react/test/CustomFilterComponent.tsx | 6 +++--- griddle-react/test/CustomHeaderComponent.tsx | 8 ++++---- griddle-react/tsconfig.json | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/griddle-react/test/CustomFilterComponent.tsx b/griddle-react/test/CustomFilterComponent.tsx index cb06f11703..4d1353d4ee 100644 --- a/griddle-react/test/CustomFilterComponent.tsx +++ b/griddle-react/test/CustomFilterComponent.tsx @@ -26,8 +26,8 @@ var customFilterFunction = function(items: ResultType[], query: string): ResultT class CustomFilterComponent extends React.Component { query: string = ''; - searchChange(event) { - this.query = event.target.value; + searchChange(event: React.FormEvent) { + this.query = event.currentTarget.value; this.props.changeFilter(this.query); } @@ -88,4 +88,4 @@ class CustomFilterComponentGrid extends React.Component { } } -export default CustomFilterComponentGrid; \ No newline at end of file +export default CustomFilterComponentGrid; diff --git a/griddle-react/test/CustomHeaderComponent.tsx b/griddle-react/test/CustomHeaderComponent.tsx index 359cfc74a8..aed7d348aa 100644 --- a/griddle-react/test/CustomHeaderComponent.tsx +++ b/griddle-react/test/CustomHeaderComponent.tsx @@ -12,12 +12,12 @@ interface MoreCustomHeaderComponentProps extends CustomHeaderComponentProps { } class HeaderComponent extends React.Component { - textOnClick(e) { + textOnClick(e: React.FormEvent) { e.stopPropagation(); } - filterText(e) { - this.props.filterByColumn(e.target.value, this.props.columnName) + filterText(e: React.FormEvent) { + this.props.filterByColumn(e.currentTarget.value, this.props.columnName) } render() { @@ -92,4 +92,4 @@ class CustomHeaderComponentGrid extends React.Component { } } -export default CustomHeaderComponentGrid; \ No newline at end of file +export default CustomHeaderComponentGrid; diff --git a/griddle-react/tsconfig.json b/griddle-react/tsconfig.json index 2482b52409..5dd6f9d98b 100644 --- a/griddle-react/tsconfig.json +++ b/griddle-react/tsconfig.json @@ -6,7 +6,7 @@ "dom" ], "jsx": "preserve", - "noImplicitAny": false, + "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, "baseUrl": "../", From b16bfba18fc6c227fba117c4e30fa6b5691ce358 Mon Sep 17 00:00:00 2001 From: Keith Dahlby Date: Tue, 7 Mar 2017 08:53:29 -0600 Subject: [PATCH 78/81] Use arrow function --- griddle-react/test/CustomFilterComponent.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/griddle-react/test/CustomFilterComponent.tsx b/griddle-react/test/CustomFilterComponent.tsx index 4d1353d4ee..e7508887f5 100644 --- a/griddle-react/test/CustomFilterComponent.tsx +++ b/griddle-react/test/CustomFilterComponent.tsx @@ -8,7 +8,7 @@ import * as _ from 'lodash'; import * as React from 'react'; import Griddle, { CustomFilterComponentProps } from 'griddle-react'; -var customFilterFunction = function(items: ResultType[], query: string): ResultType[] { +const CustomFilterFunction = (items: ResultType[], query: string): ResultType[] => { return _.filter(items, (item) => { let match = false; @@ -82,7 +82,7 @@ class CustomFilterComponentGrid extends React.Component { return ( ); } From 625be7cb6522b3d004b2fe93ace7357686eeb3a4 Mon Sep 17 00:00:00 2001 From: Christian Svensson Date: Tue, 7 Mar 2017 16:09:22 +0100 Subject: [PATCH 79/81] make auth0-js work with module syntax --- auth0-js/auth0-js-tests.ts | 2 +- auth0-js/index.d.ts | 871 ++++++++++++++++++------------------- 2 files changed, 436 insertions(+), 437 deletions(-) diff --git a/auth0-js/auth0-js-tests.ts b/auth0-js/auth0-js-tests.ts index 7c910d1765..4d3b08bed4 100644 --- a/auth0-js/auth0-js-tests.ts +++ b/auth0-js/auth0-js-tests.ts @@ -1,4 +1,4 @@ -import 'auth0-js'; +import * as auth0 from 'auth0-js'; let webAuth = new auth0.WebAuth({ domain: 'mine.auth0.com', diff --git a/auth0-js/index.d.ts b/auth0-js/index.d.ts index 11cf16a3ed..cc408023bc 100644 --- a/auth0-js/index.d.ts +++ b/auth0-js/index.d.ts @@ -3,454 +3,453 @@ // Definitions by: Adrian Chia // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -declare namespace auth0 { +export as namespace auth0; - export class Authentication { - constructor(options: AuthOptions); - passwordless: PasswordlessAuthentication; - dbConnection: DBConnection; +export class Authentication { + constructor(options: AuthOptions); - /** - * Builds and returns the `/authorize` url in order to initialize a new authN/authZ transaction - * - * @method buildAuthorizeUrl - * @param {Object} options: https://auth0.com/docs/api/authentication#!#get--authorize_db - */ - buildAuthorizeUrl(options: any): string; + passwordless: PasswordlessAuthentication; + dbConnection: DBConnection; - /** - * Builds and returns the Logout url in order to initialize a new authN/authZ transaction - * - * @method buildLogoutUrl - * @param {Object} options: https://auth0.com/docs/api/authentication#!#get--v2-logout - */ - buildLogoutUrl(options?: any): string; + /** + * Builds and returns the `/authorize` url in order to initialize a new authN/authZ transaction + * + * @method buildAuthorizeUrl + * @param {Object} options: https://auth0.com/docs/api/authentication#!#get--authorize_db + */ + buildAuthorizeUrl(options: any): string; - /** - * Makes a call to the `oauth/token` endpoint with `password` grant type - * - * @method loginWithDefaultDirectory - * @param {Object} options: https://auth0.com/docs/api-auth/grant/password - * @param {Function} callback - */ - loginWithDefaultDirectory(options: any, callback: (error?: Auth0Error, authResult?: any) => any): void; + /** + * Builds and returns the Logout url in order to initialize a new authN/authZ transaction + * + * @method buildLogoutUrl + * @param {Object} options: https://auth0.com/docs/api/authentication#!#get--v2-logout + */ + buildLogoutUrl(options?: any): string; - /** - * Makes a call to the `/ro` endpoint - * @param {any} options - * @param {Function} callback - * @deprecated `loginWithResourceOwner` will be soon deprecated, user `login` instead. - */ - loginWithResourceOwner(options: any, callback: (error?: Auth0Error, authResult?: any) => any): void; + /** + * Makes a call to the `oauth/token` endpoint with `password` grant type + * + * @method loginWithDefaultDirectory + * @param {Object} options: https://auth0.com/docs/api-auth/grant/password + * @param {Function} callback + */ + loginWithDefaultDirectory(options: any, callback: (error?: Auth0Error, authResult?: any) => any): void; - /** - * Makes a call to the `oauth/token` endpoint with `password-realm` grant type - * @param {any} options - * @param {Function} callback - */ - login(options: any, callback: (error?: Auth0Error, authResult?: any) => any): void; + /** + * Makes a call to the `/ro` endpoint + * @param {any} options + * @param {Function} callback + * @deprecated `loginWithResourceOwner` will be soon deprecated, user `login` instead. + */ + loginWithResourceOwner(options: any, callback: (error?: Auth0Error, authResult?: any) => any): void; - /** - * Makes a call to the `oauth/token` endpoint - * @param {any} options - * @param {Function} callback - */ - oauthToken(options: any, callback: (error?: Auth0Error, authResult?: any) => any): void; + /** + * Makes a call to the `oauth/token` endpoint with `password-realm` grant type + * @param {any} options + * @param {Function} callback + */ + login(options: any, callback: (error?: Auth0Error, authResult?: any) => any): void; - /** - * Makes a call to the `/ssodata` endpoint - * - * @method getSSOData - * @param {Boolean} withActiveDirectories - * @param {Function} callback - * @deprecated `getSSOData` will be soon deprecated. - */ - getSSOData(callback?: (error?: Auth0Error, authResult?: any) => any): void; + /** + * Makes a call to the `oauth/token` endpoint + * @param {any} options + * @param {Function} callback + */ + oauthToken(options: any, callback: (error?: Auth0Error, authResult?: any) => any): void; - /** - * Makes a call to the `/ssodata` endpoint - * - * @method getSSOData - * @param {Boolean} withActiveDirectories - * @param {Function} callback - * @deprecated `getSSOData` will be soon deprecated. - */ - getSSOData(withActiveDirectories: boolean, callback?: (error?: Auth0Error, authResult?: any) => any): void; + /** + * Makes a call to the `/ssodata` endpoint + * + * @method getSSOData + * @param {Boolean} withActiveDirectories + * @param {Function} callback + * @deprecated `getSSOData` will be soon deprecated. + */ + getSSOData(callback?: (error?: Auth0Error, authResult?: any) => any): void; - /** - * Makes a call to the `/userinfo` endpoint and returns the user profile - * - * @method userInfo - * @param {String} accessToken - * @param {Function} callback - */ - userInfo(token: string, callback: (error?: Auth0Error, user?: any) => any): void; + /** + * Makes a call to the `/ssodata` endpoint + * + * @method getSSOData + * @param {Boolean} withActiveDirectories + * @param {Function} callback + * @deprecated `getSSOData` will be soon deprecated. + */ + getSSOData(withActiveDirectories: boolean, callback?: (error?: Auth0Error, authResult?: any) => any): void; - /** - * Makes a call to the `/delegation` endpoint - * - * @method delegation - * @param {Object} options: https://auth0.com/docs/api/authentication#!#post--delegation - * @param {Function} callback - * @deprecated `delegation` will be soon deprecated. - */ - delegation(options: any, callback: (error?: Auth0Error, authResult?: Auth0DelegationToken) => any): any; + /** + * Makes a call to the `/userinfo` endpoint and returns the user profile + * + * @method userInfo + * @param {String} accessToken + * @param {Function} callback + */ + userInfo(token: string, callback: (error?: Auth0Error, user?: any) => any): void; - /** - * Fetches the user country based on the ip. - * - * @method getUserCountry - * @param {Function} callback - */ - getUserCountry(callback: (error?: Auth0Error, result?: any) => any): void; - } - - export class PasswordlessAuthentication { - constructor(request: any, option: any); - - /** - * Builds and returns the passwordless TOTP verify url in order to initialize a new authN/authZ transaction - * - * @method buildVerifyUrl - * @param {Object} options - * @param {Function} callback - */ - buildVerifyUrl(options: any): string; - - /** - * Initializes a new passwordless authN/authZ transaction - * - * @method start - * @param {Object} options: https://auth0.com/docs/api/authentication#passwordless - * @param {Function} callback - */ - start(options: PasswordlessStartOptions, callback: any): void; - - /** - * Verifies the passwordless TOTP and returns an error if any. - * - * @method buildVerifyUrl - * @param {Object} options - * @param {Function} callback - */ - verify(options: any, callback: any): void; - } - - export class DBConnection { - constructor(request: any, option: any); - - /** - * Signup a new user - * - * @method signup - * @param {Object} options: https://auth0.com/docs/api/authentication#!#post--dbconnections-signup - * @param {Function} calback - */ - signup(options: any, callback: any): void; - - /** - * Initializes the change password flow - * - * @method signup - * @param {Object} options: https://auth0.com/docs/api/authentication#!#post--dbconnections-change_password - * @param {Function} callback - */ - changePassword(options: ChangePasswordOptions, callback: any): void; - } - - export class Management { - constructor(options: ManagementOptions); - - /** - * Returns the user profile. https://auth0.com/docs/api/management/v2#!/Users/get_users_by_id - * - * @method getUser - * @param {String} userId - * @param {Function} callback - */ - getUser(userId: string, callback: (error?: Auth0Error, user?: any) => any): void; - - /** - * Updates the user metdata. It will patch the user metdata with the attributes sent. - * https://auth0.com/docs/api/management/v2#!/Users/patch_users_by_id - * - * @method patchUserMetadata - * @param {String} userId - * @param {Object} userMetadata - * @param {Function} callback - */ - patchUserMetadata(userId: string, userMetadata: any, callback: (error?: Auth0Error, user?: any) => any): void; - - /** - * Link two users. https://auth0.com/docs/api/management/v2#!/Users/post_identities - * - * @method linkUser - * @param {String} userId - * @param {String} secondaryUserToken - * @param {Function} callback - */ - linkUser(userId: string, secondaryUserToken: string, callback: (error?: Auth0Error, user?: any) => any): void; - } - - export class WebAuth { - constructor(options: AuthOptions); - client: Authentication; - popup: Popup; - redirect: Redirect; - - /** - * Redirects to the hosted login page (`/authorize`) in order to initialize a new authN/authZ transaction - * - * @method authorize - * @param {Object} options: https://auth0.com/docs/api/authentication#!#get--authorize_db - */ - authorize(options: any): void; - - /** - * Parse the url hash and extract the returned tokens depending on the transaction. - * - * Only validates id_tokens signed by Auth0 using the RS256 algorithm using the public key exposed - * by the `/.well-known/jwks.json` endpoint. Id tokens signed with other algorithms will not be - * accepted. - * - * @method parseHash - * @param {Object} options: - * @param {String} options.state [OPTIONAL] to verify the response - * @param {String} options.nonce [OPTIONAL] to verify the id_token - * @param {String} options.hash [OPTIONAL] the url hash. If not provided it will extract from window.location.hash - * @param {Function} callback: any(err, token_payload) - */ - parseHash(options: any, callback: (error?: Auth0Error, authResult?: any) => any): void; - - /** - * Decodes the id_token and verifies the nonce. - * - * @method validateToken - * @param {String} token - * @param {String} state - * @param {String} nonce - * @param {Function} callback: function(err, {payload, transaction}) - */ - validateToken(token: string, state: string, nonce: string, callback: any): void; - - /** - * Executes a silent authentication transaction under the hood in order to fetch a new token. - * - * @method renewAuth - * @param {Object} options: any valid oauth2 parameter to be sent to the `/authorize` endpoint - * @param {Function} callback - */ - renewAuth(options: any, callback: (error?: Auth0Error, authResult?: any) => any): void; - - /** - * Initialices a change password transaction - * - * @method changePassword - * @param {Object} options: https://auth0.com/docs/api/authentication#!#post--dbconnections-change_password - * @param {Function} callback - */ - changePassword(options: any, callback: (error?: Auth0Error, authResult?: any) => any): void; - - /** - * Signs up a new user - * - * @method signup - * @param {Object} options: https://auth0.com/docs/api/authentication#!#post--dbconnections-signup - * @param {Function} callback - */ - signup(options: any, callback: any): void; - - /** - * Signs up a new user, automatically logs the user in after the signup and returns the user token. - * The login will be done using /oauth/token with password-realm grant type. - * - * @method signupAndAuthorize - * @param {Object} options: https://auth0.com/docs/api/authentication#!#post--dbconnections-signup - * @param {Function} callback - */ - signupAndAuthorize(options: any, callback: (error?: Auth0Error, authResult?: any) => any): void; - - /** - * Redirects to the auth0 logout page - * - * @method logout - * @param {Object} options: https://auth0.com/docs/api/authentication#!#get--v2-logout - */ - logout(options: any): void; - - passwordlessStart(options: PasswordlessStartOptions, callback: (error?: Auth0Error, data?: any) => any): void; - - /** - * Verifies the passwordless TOTP and redirects to finish the passwordless transaction - * - * @method passwordlessVerify - * @param {Object} options: - * @param {Object} options.type: `sms` or `email` - * @param {Object} options.phoneNumber: only if type = sms - * @param {Object} options.email: only if type = email - * @param {Object} options.connection: the connection name - * @param {Object} options.verificationCode: the TOTP code - * @param {Function} callback - */ - passwordlessVerify(options: any, callback: any): void; - } - - export class Redirect { - constructor(client: any, options: any); - - /** - * Initializes the legacy Lock login flow in a popup - * - * @method loginWithCredentials - * @param {Object} options - * @param {Function} callback - * @deprecated `webauth.popup.loginWithCredentials` will be soon deprecated, use `webauth.client.login` instead. - */ - loginWithCredentials(options: any, callback: any): void; - - /** - * Signs up a new user and automatically logs the user in after the signup. - * - * @method signupAndLogin - * @param {Object} options: https://auth0.com/docs/api/authentication#!#post--dbconnections-signup - * @param {Function} callback - */ - signupAndLogin(options: any, callback: any): void; - } - - export class Popup { - constructor(client: any, options: any); - - /** - * Initializes the popup window and returns the instance to be used later in order to avoid being blocked by the browser. - * - * @method preload - * @param {Object} options: receives the window height and width and any other window feature to be sent to window.open - */ - preload(options: any): any; - - /** - * Internal use. - * - * @method getPopupHandler - */ - getPopupHandler(options: any, preload: boolean): any; - /** - * Opens in a popup the hosted login page (`/authorize`) in order to initialize a new authN/authZ transaction - * - * @method authorize - * @param {Object} options: https://auth0.com/docs/api/authentication#!#get--authorize_db - * @param {Function} callback - */ - authorize(options: any, callback: any): void; - - /** - * Initializes the legacy Lock login flow in a popup - * - * @method loginWithCredentials - * @param {Object} options - * @param {Function} callback - * @deprecated `webauth.popup.loginWithCredentials` will be soon deprecated, use `webauth.client.login` instead. - */ - loginWithCredentials(options: any, callback: any): void; - - /** - * Verifies the passwordless TOTP and returns the requested token - * - * @method passwordlessVerify - * @param {Object} options: - * @param {Object} options.type: `sms` or `email` - * @param {Object} options.phoneNumber: only if type = sms - * @param {Object} options.email: only if type = email - * @param {Object} options.connection: the connection name - * @param {Object} options.verificationCode: the TOTP code - * @param {Function} callback - */ - passwordlessVerify(options: any, callback: any): void; - - /** - * Signs up a new user and automatically logs the user in after the signup. - * - * @method signupAndLogin - * @param {Object} options: https://auth0.com/docs/api/authentication#!#post--dbconnections-signup - * @param {Function} callback - */ - signupAndLogin(options: any, callback: any): void; - } - - interface ManagementOptions { - domain: string; - token: string; - _sendTelemetry?: boolean; - _telemetryInfo?: any; - } - - interface AuthOptions { - domain: string; - clientID: string; - responseType?: string; - responseMode?: string; - redirectUri?: string; - scope?: string; - audience?: string; - leeway?: number; - _disableDeprecationWarnings?: boolean; - _sendTelemetry?: boolean; - _telemetryInfo?: any; - } - - interface PasswordlessAuthOptions { - connection: string; - verificationCode: string; - phoneNumber: string; - email: string; - } - - interface Auth0Error { - error: any; - errorDescription: string; - } - - interface Auth0DecodedHash { - accessToken?: string; - idToken?: string; - idTokenPayload?: any; - refreshToken?: string; - state?: string; - expiresIn?: number; - tokenType?: string; - } - - /** Represents the response from an API Token Delegation request. */ - interface Auth0DelegationToken { - /** The length of time in seconds the token is valid for. */ - ExpiresIn: number; - /** The JWT for delegated access. */ - idToken: string; - /** The type of token being returned. Possible values: "Bearer" */ - tokenType: string; - } - - interface ChangePasswordOptions { - connection: string; - email: string; - password?: string; - } - - interface PasswordlessStartOptions { - connection: string; - send: string; - phoneNumber?: string; - email?: string; - authParams?: any; - } - - interface PasswordlessVerifyOptions { - connection: string; - verificationCode: string; - phoneNumber?: string; - email?: string; - } + /** + * Makes a call to the `/delegation` endpoint + * + * @method delegation + * @param {Object} options: https://auth0.com/docs/api/authentication#!#post--delegation + * @param {Function} callback + * @deprecated `delegation` will be soon deprecated. + */ + delegation(options: any, callback: (error?: Auth0Error, authResult?: Auth0DelegationToken) => any): any; + /** + * Fetches the user country based on the ip. + * + * @method getUserCountry + * @param {Function} callback + */ + getUserCountry(callback: (error?: Auth0Error, result?: any) => any): void; +} + +export class PasswordlessAuthentication { + constructor(request: any, option: any); + + /** + * Builds and returns the passwordless TOTP verify url in order to initialize a new authN/authZ transaction + * + * @method buildVerifyUrl + * @param {Object} options + * @param {Function} callback + */ + buildVerifyUrl(options: any): string; + + /** + * Initializes a new passwordless authN/authZ transaction + * + * @method start + * @param {Object} options: https://auth0.com/docs/api/authentication#passwordless + * @param {Function} callback + */ + start(options: PasswordlessStartOptions, callback: any): void; + + /** + * Verifies the passwordless TOTP and returns an error if any. + * + * @method buildVerifyUrl + * @param {Object} options + * @param {Function} callback + */ + verify(options: any, callback: any): void; +} + +export class DBConnection { + constructor(request: any, option: any); + + /** + * Signup a new user + * + * @method signup + * @param {Object} options: https://auth0.com/docs/api/authentication#!#post--dbconnections-signup + * @param {Function} calback + */ + signup(options: any, callback: any): void; + + /** + * Initializes the change password flow + * + * @method signup + * @param {Object} options: https://auth0.com/docs/api/authentication#!#post--dbconnections-change_password + * @param {Function} callback + */ + changePassword(options: ChangePasswordOptions, callback: any): void; +} + +export class Management { + constructor(options: ManagementOptions); + + /** + * Returns the user profile. https://auth0.com/docs/api/management/v2#!/Users/get_users_by_id + * + * @method getUser + * @param {String} userId + * @param {Function} callback + */ + getUser(userId: string, callback: (error?: Auth0Error, user?: any) => any): void; + + /** + * Updates the user metdata. It will patch the user metdata with the attributes sent. + * https://auth0.com/docs/api/management/v2#!/Users/patch_users_by_id + * + * @method patchUserMetadata + * @param {String} userId + * @param {Object} userMetadata + * @param {Function} callback + */ + patchUserMetadata(userId: string, userMetadata: any, callback: (error?: Auth0Error, user?: any) => any): void; + + /** + * Link two users. https://auth0.com/docs/api/management/v2#!/Users/post_identities + * + * @method linkUser + * @param {String} userId + * @param {String} secondaryUserToken + * @param {Function} callback + */ + linkUser(userId: string, secondaryUserToken: string, callback: (error?: Auth0Error, user?: any) => any): void; +} + +export class WebAuth { + constructor(options: AuthOptions); + client: Authentication; + popup: Popup; + redirect: Redirect; + + /** + * Redirects to the hosted login page (`/authorize`) in order to initialize a new authN/authZ transaction + * + * @method authorize + * @param {Object} options: https://auth0.com/docs/api/authentication#!#get--authorize_db + */ + authorize(options: any): void; + + /** + * Parse the url hash and extract the returned tokens depending on the transaction. + * + * Only validates id_tokens signed by Auth0 using the RS256 algorithm using the public key exposed + * by the `/.well-known/jwks.json` endpoint. Id tokens signed with other algorithms will not be + * accepted. + * + * @method parseHash + * @param {Object} options: + * @param {String} options.state [OPTIONAL] to verify the response + * @param {String} options.nonce [OPTIONAL] to verify the id_token + * @param {String} options.hash [OPTIONAL] the url hash. If not provided it will extract from window.location.hash + * @param {Function} callback: any(err, token_payload) + */ + parseHash(options: any, callback: (error?: Auth0Error, authResult?: any) => any): void; + + /** + * Decodes the id_token and verifies the nonce. + * + * @method validateToken + * @param {String} token + * @param {String} state + * @param {String} nonce + * @param {Function} callback: function(err, {payload, transaction}) + */ + validateToken(token: string, state: string, nonce: string, callback: any): void; + + /** + * Executes a silent authentication transaction under the hood in order to fetch a new token. + * + * @method renewAuth + * @param {Object} options: any valid oauth2 parameter to be sent to the `/authorize` endpoint + * @param {Function} callback + */ + renewAuth(options: any, callback: (error?: Auth0Error, authResult?: any) => any): void; + + /** + * Initialices a change password transaction + * + * @method changePassword + * @param {Object} options: https://auth0.com/docs/api/authentication#!#post--dbconnections-change_password + * @param {Function} callback + */ + changePassword(options: any, callback: (error?: Auth0Error, authResult?: any) => any): void; + + /** + * Signs up a new user + * + * @method signup + * @param {Object} options: https://auth0.com/docs/api/authentication#!#post--dbconnections-signup + * @param {Function} callback + */ + signup(options: any, callback: any): void; + + /** + * Signs up a new user, automatically logs the user in after the signup and returns the user token. + * The login will be done using /oauth/token with password-realm grant type. + * + * @method signupAndAuthorize + * @param {Object} options: https://auth0.com/docs/api/authentication#!#post--dbconnections-signup + * @param {Function} callback + */ + signupAndAuthorize(options: any, callback: (error?: Auth0Error, authResult?: any) => any): void; + + /** + * Redirects to the auth0 logout page + * + * @method logout + * @param {Object} options: https://auth0.com/docs/api/authentication#!#get--v2-logout + */ + logout(options: any): void; + + passwordlessStart(options: PasswordlessStartOptions, callback: (error?: Auth0Error, data?: any) => any): void; + + /** + * Verifies the passwordless TOTP and redirects to finish the passwordless transaction + * + * @method passwordlessVerify + * @param {Object} options: + * @param {Object} options.type: `sms` or `email` + * @param {Object} options.phoneNumber: only if type = sms + * @param {Object} options.email: only if type = email + * @param {Object} options.connection: the connection name + * @param {Object} options.verificationCode: the TOTP code + * @param {Function} callback + */ + passwordlessVerify(options: any, callback: any): void; +} + +export class Redirect { + constructor(client: any, options: any); + + /** + * Initializes the legacy Lock login flow in a popup + * + * @method loginWithCredentials + * @param {Object} options + * @param {Function} callback + * @deprecated `webauth.popup.loginWithCredentials` will be soon deprecated, use `webauth.client.login` instead. + */ + loginWithCredentials(options: any, callback: any): void; + + /** + * Signs up a new user and automatically logs the user in after the signup. + * + * @method signupAndLogin + * @param {Object} options: https://auth0.com/docs/api/authentication#!#post--dbconnections-signup + * @param {Function} callback + */ + signupAndLogin(options: any, callback: any): void; +} + +export class Popup { + constructor(client: any, options: any); + + /** + * Initializes the popup window and returns the instance to be used later in order to avoid being blocked by the browser. + * + * @method preload + * @param {Object} options: receives the window height and width and any other window feature to be sent to window.open + */ + preload(options: any): any; + + /** + * Internal use. + * + * @method getPopupHandler + */ + getPopupHandler(options: any, preload: boolean): any; + /** + * Opens in a popup the hosted login page (`/authorize`) in order to initialize a new authN/authZ transaction + * + * @method authorize + * @param {Object} options: https://auth0.com/docs/api/authentication#!#get--authorize_db + * @param {Function} callback + */ + authorize(options: any, callback: any): void; + + /** + * Initializes the legacy Lock login flow in a popup + * + * @method loginWithCredentials + * @param {Object} options + * @param {Function} callback + * @deprecated `webauth.popup.loginWithCredentials` will be soon deprecated, use `webauth.client.login` instead. + */ + loginWithCredentials(options: any, callback: any): void; + + /** + * Verifies the passwordless TOTP and returns the requested token + * + * @method passwordlessVerify + * @param {Object} options: + * @param {Object} options.type: `sms` or `email` + * @param {Object} options.phoneNumber: only if type = sms + * @param {Object} options.email: only if type = email + * @param {Object} options.connection: the connection name + * @param {Object} options.verificationCode: the TOTP code + * @param {Function} callback + */ + passwordlessVerify(options: any, callback: any): void; + + /** + * Signs up a new user and automatically logs the user in after the signup. + * + * @method signupAndLogin + * @param {Object} options: https://auth0.com/docs/api/authentication#!#post--dbconnections-signup + * @param {Function} callback + */ + signupAndLogin(options: any, callback: any): void; +} + +interface ManagementOptions { + domain: string; + token: string; + _sendTelemetry?: boolean; + _telemetryInfo?: any; +} + +interface AuthOptions { + domain: string; + clientID: string; + responseType?: string; + responseMode?: string; + redirectUri?: string; + scope?: string; + audience?: string; + leeway?: number; + _disableDeprecationWarnings?: boolean; + _sendTelemetry?: boolean; + _telemetryInfo?: any; +} + +interface PasswordlessAuthOptions { + connection: string; + verificationCode: string; + phoneNumber: string; + email: string; +} + +interface Auth0Error { + error: any; + errorDescription: string; +} + +interface Auth0DecodedHash { + accessToken?: string; + idToken?: string; + idTokenPayload?: any; + refreshToken?: string; + state?: string; + expiresIn?: number; + tokenType?: string; +} + +/** Represents the response from an API Token Delegation request. */ +interface Auth0DelegationToken { + /** The length of time in seconds the token is valid for. */ + ExpiresIn: number; + /** The JWT for delegated access. */ + idToken: string; + /** The type of token being returned. Possible values: "Bearer" */ + tokenType: string; +} + +interface ChangePasswordOptions { + connection: string; + email: string; + password?: string; +} + +interface PasswordlessStartOptions { + connection: string; + send: string; + phoneNumber?: string; + email?: string; + authParams?: any; +} + +interface PasswordlessVerifyOptions { + connection: string; + verificationCode: string; + phoneNumber?: string; + email?: string; } From c1ea67d097dabbadbbbdbdaa750b911ce82250bc Mon Sep 17 00:00:00 2001 From: Alan Thai Date: Tue, 7 Mar 2017 12:27:45 -0500 Subject: [PATCH 80/81] @types/ramda aperture incorrect type signature The `list` argument should be `T[]` instead of `T`. --- ramda/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ramda/index.d.ts b/ramda/index.d.ts index 114ba38d6d..3e79c3cd4c 100644 --- a/ramda/index.d.ts +++ b/ramda/index.d.ts @@ -185,8 +185,8 @@ declare namespace R { * Returns a new list, composed of n-tuples of consecutive elements If n is greater than the length of the list, * an empty list is returned. */ - aperture(n: number, list: T): T[][]; - aperture(n: number): (list: T) => T[][]; + aperture(n: number, list: T[]): T[][]; + aperture(n: number): (list: T[]) => T[][]; /** * Returns a new list containing the contents of the given list, followed by the given element. From cabdb36ee7c52efe31e985dbd058f085d38fe517 Mon Sep 17 00:00:00 2001 From: Chad Auld Date: Tue, 7 Mar 2017 11:40:42 -0700 Subject: [PATCH 81/81] Adding listStyle, menuItemStyle, & selectedMenuItemStyle to the material-ui SelectField property list --- material-ui/index.d.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/material-ui/index.d.ts b/material-ui/index.d.ts index c95d6992c5..529b9fe9fe 100644 --- a/material-ui/index.d.ts +++ b/material-ui/index.d.ts @@ -1332,6 +1332,9 @@ declare namespace __MaterialUI { className?: string; maxHeight?: number; menuStyle?: any; + listStyle?: React.CSSProperties; + menuItemStyle?: React.CSSProperties; + selectedMenuItemStyle?: React.CSSProperties; openImmediately?: boolean; } export class SelectField extends React.Component {